About 55,000 results
Open links in new tab
  1. Using the indexOf method on an array of objects - Stack Overflow

    17 I like Pablo's answer, but Array#indexOf and Array#map don't work on all browsers. Underscore will use native code if it's available, but has fallbacks as well. Plus it has the pluck …

  2. What is the difference between indexOf () and search ()?

    Dec 9, 2008 · If your situation requires the use of a regular expression, use the search() method, otherwise; the indexOf() method is more performant.

  3. Difference Between indexOf and findIndex function of array

    Jan 3, 2017 · I am confused between the difference between the two function indexOf and find Index in an array. The documentation says findIndex - Returns the index of the first element in …

  4. javascript - Why does IndexOf return -1? - Stack Overflow

    Dec 21, 2011 · I am learning Javascript and don't understand why the indexOf below returns -1: var string = "The quick brown fox jumps over the lazy dog"; console.log (string.indexOf("good"));

  5. javascript - indexOf () > -1 vs indexOf () != -1 - Stack Overflow

    Dec 20, 2017 · 1 indexOf returns a -1 if the search is not in the string. This is because indexOf will return the position of the search term in the string. For example > -1 is another way of saying …

  6. Newest 'indexof' Questions - Stack Overflow

    Stack Overflow | The World’s Largest Online Community for Developers

  7. Where is Java's Array indexOf? - Stack Overflow

    Feb 10, 2011 · 22 Unlike in C# where you have the Array.IndexOf method, and JavaScript where you have the indexOf method, Java's API (the Array and Arrays classes in particular) have no …

  8. indexOf methods in if statement - Stack Overflow

    Nov 27, 2019 · indexOf "inside if" is irrelevant. Only the results of such (and the incorrect expectation of usages are); replacing with the actual value would have the same effect. So …

  9. JavaScript: String.indexOf(...) allowing regular-expressions?

    In javascript, is there an equivalent of String.indexOf (...) that takes a regular expression instead of a string for the first parameter, while still allowing a second parameter ? I need to do some...

  10. JavaScript indexOf method with multiple values - Stack Overflow

    2 You can use the fromIndex of Array#indexOf. fromIndex The index to start the search at. If the index is greater than or equal to the array's length, -1 is returned, which means the array will …