arr.filter(callback[, thisArg])
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
So, this is the example in the documentation that I am supposed to understand.
Arr = some array, great. filter = a method the array has, great. callback = some function, basically. Great. What is [, thisArg]
though?
Looking at some example on stackoverflow shows this:
objects.filter(function (obj) {
return obj.someIntProp <= 1000
});
I understand how this works, I don't need help using it. I just want to understand how [, thisArg]
is supposed to tell me that the function takes each object in an array. I feel like I am missing something obvious that most people get taught in Coding 101.