javascript - JS / Jquery - Remove multiple elements from an array by keys -
javascript - JS / Jquery - Remove multiple elements from an array by keys -
i have set of keys (for illustration 2,3,4,101,102,454).
i'd remove elements these keys array. there way remove them @ once?
i tried iterating through for
loop, , using splice
remove elements 1 one, never removed elements - guess because modifies array i'm looping through.
go backwards.
if loop thru 0 -> n, modify indexes of elements coming after item removed.
if go backwards, n -> 0, don't have problem.
javascript jquery arrays
Comments
Post a Comment