I have an array coming from the database grabbing all the id\'s from a group of elements. However it seems to also be grabbing some negative id\'s from some backend stuff ha
Use grep:
ids = [-1,3,4,-2] ids = jQuery.grep(ids, function( n, i ) { return n>=0; }); console.log(ids)
Description: Finds the elements of an array which satisfy a filter function. The original array is not affected.