Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove elements from array with value

Array.prototype.spliceAll = function (criteria) {
  return this.filter(e=>e !== criteria) }
let newArray = myArray.spliceAll('removeThisString')
/*//*\_AS A PROTOTYPE METHOD |OR| AS AN ARROW FUNCTION_/|**/
const spliceAll = (a,c) => a.filter(e=>e !== c)
let newArray = spliceAll(myArray, 'removeThisString')
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #remove #elements #array
ADD COMMENT
Topic
Name
1+6 =