Filter() method

PHOTO EMBED

Thu May 12 2022 17:34:46 GMT+0000 (Coordinated Universal Time)

Saved by @Luduwanda #javascriptreact

const myArray = [2,4,5,6,9]

my.Array.filter(el => el < 5)

//keeps anything in new array that returns true
// [2,4]

//but it does not mutate the array, so
myArray
// remains  [2,4,5,6,9]
content_copyCOPY