Tell us what’s happening:
Hello everyone,
I am trying to understand why it uses !==5 instead of just saying… val===5 … or is it just preference in this situation.
The following code is an example of using filter to remove array elements that are equal to five:
array = array.filter(function(val) {
return val !== 5;
});
Thanks
Your code so far
var oldArray = [1,2,3,4,5,6,7,8,9,10];
// Only change code below this line.
var newArray = oldArray.filter(function(val){
return val < 6;
});
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6
.
Link to the challenge:
https://www.freecodecamp.org/challenges/filter-arrays-with-filter