Tell us what’s happening:
It would be helpful to reword this challenge to say:
“… Modify the function, using a for
loop, to return a filtered version of the passed array such that any array nested within arr
containing elem
gets added to the newArr.”
In essence we are’t removing anything from the original array, just adding the subarray to a new array IF it contains elem parameter.