About 29,200 results
Open links in new tab
  1. javascript - Using the indexOf method on an array of objects

    Using the indexOf method on an array of objects Asked 13 years, 11 months ago Modified 3 months ago Viewed 927k times

  2. Difference Between indexOf and findIndex function of array

    Jan 3, 2017 · Furthermore, indexOf () compares searchElement to elements of the Array using strict equality (the same method used by the === or triple-equals operator).

  3. 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...

  4. JavaScript indexOf method with multiple values - Stack Overflow

    JavaScript indexOf method with multiple values Asked 9 years, 7 months ago Modified 3 years, 11 months ago Viewed 67k times

  5. 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"));

  6. javascript - 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.

  7. How does the `indexOf` method on a string work in JavaScript?

    Jan 1, 2022 · The indexOf function of a string does not return a character but rather returns the position of the first place that string or character is found, not the character itself.

  8. JavaScript indexOf to ignore Case - Stack Overflow

    I am trying to find if an image has in its source name noPic which can be in upper or lower case. var noPic = largeSrc.indexOf("nopic"); Should I write : var noPic = …

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

    Dec 20, 2017 · 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 …

  10. javascript - Contains case insensitive - Stack Overflow

    Oct 2, 2012 · Add .toUpperCase() after referrer. This method turns the string into an upper case string. Then, use .indexOf() using RAL instead of Ral.