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

Popular posts from this blog

php - SPIP: From Tag directly to an article -

jquery - isAjaxRequest always return false -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -