SYNTAX – array.filter(function(currentValue, index, arr), thisValue)
- function- This parameter tells the function to be called for each element of the array.
- currentValue – This parameter holds the value of the elements being processed currently.
- Index – This is optional and it stores the index of the current element in the array starting from 0.
- arr- This parameter is optional and it holds the complete array on which Array.every (tests whether all the elements pass the provided function) is called.
- thisValue – This is optional, it holds the context to be passed as this is to be used while executing the callback function. If it is passed, it has to be used like this for every invocation of the callback function, or else undefined is used as default.