I have a JS array made with jQuery toArray() method containing all li elements from a div. Now I try to get the index of the array containing a certain string: showing.
I have tried .index, .filter, but it all gives me the same error message,
arraySlides.index is not a function
logic.js:218 Uncaught TypeError: showing is not a function
This is my array:
[li.slide.showing, li.slide, li.slide]
0:li.slide.showing
1:li.slide
2:li.slide
length:3
__proto__:Array(0)
Is it not working because I try to find a string?
var current = arraySlides.index('showing');
Ok maybe I wasn't clear. I am trying to get the index, so a number from which position in the array the classname contains showing..
indexOf, notindex. However,filteris an extant method, so I'm surprised that you see a not-a-function error for that, unless you're using an old browser.