Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript filter array return index

const polyfillter = (arr,condition) => arr.map( (e,i) => condition ? i : -1).filter(e=>e>=0)    
//pass an array, and your filter condition and watch the magic 
 
PREVIOUS NEXT
Tagged: #javascript #filter #array #return #index
ADD COMMENT
Topic
Name
9+3 =