In javascript, is there an equivalent of String.indexOf() that takes a regular expression instead of a string for the first first parameter while still allowing a second parameter ?  I need to do something like   str.indexOf(/[abc]/ , i);   and  st...
I am already trying for over an hour and cant figure out the right way to do it, although it is probably pretty easy:  I have something like this : foo/bar/test.html  I would like to use jQuery to extract everything after the last /. In the example a...
I created a table in my HTML code. It has 9 columns and 13 rows. It gets filled up completely by a JavaScript loop that fills it with names of people from a few arrays. However, I want to add a validation step that makes sure that no two cells within...
I have a for loop which returns an array.  Return:  1st loop: arr[0] arr[1] arr[2] arr[3]   Here the length I get is 4 (Not a problem).  Return:  2nd loop arr[4] arr[5] arr[6] arr[7]  arr[8]    Here the length I get is 9.  What I want here is the act...
I am writing a script for a Google Docs Spreadsheet to read a list of directors and add them to an array if they do not already appear within it.   However, I cannot seem to get indexOf to return anything other than -1 for elements that are contained...
I have an array wich contains multiple same values  ["test234", "test9495", "test234", "test93992", "test234"]   Here I want to get the index of every test234 in the array  For that I've tried Array.prototy...
I am curious whether there exists a difference in efficiency for the indexOf method that is available for both Array and String in JavaScript. I thought the indexOf is less efficient on String than on Array, and my new testing results support this. F...
Is it possible to use multiple arguments when determining indexOf on an array?  I want to determine if my array contains any of three integers. Important to note at this stage that the array will only have one value (if it has more, it won't reac...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.