Skip to main content
added 4 characters in body
Source Link

For brevity with using ES2015 , if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)

For brevity, if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)

For brevity with using ES2015 , if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)

added 4 characters in body
Source Link

For brevity, if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)

For brevity, if you plan to simply clear the array (this is an example, insert your own function "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)

For brevity, if you plan to simply clear the array (this is an example, insert your own function for element "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)

Source Link

For brevity, if you plan to simply clear the array (this is an example, insert your own function "e", of course):

let MyArray = [1,2,3,4,5]

MyArray = [].concat(MyArray.filter(e => e > 2))

console.log(MyArray)