javascript - Get indices (indexes) of all occurrences of an element in an array -
i have array. example, [1, 2, 3, 4, 1, 2, 3, 4]. how position of first "3" , second "3" without altering array? realize similar question: javascript - position of element of array, want find position of both "3"s. know how this? (without jquery)
if just have 2 elements want know position for, can use
indexof() , lastindexof()
Comments
Post a Comment