The basic syntax for using this method uses the following structure:
from here we can identify the following parts:
- the elem variable refers to the current oldArray item we are testing against our condition.
- the condition will determine what elems will end up or not inside newArray.
- iterate through an array
- find the elements of that array that are greater than or equal to 10
- push those elements that satisfy this criteria into a new array
We can do that like this: