Items returned are of a type other than an array. This is the so-called collection. To be able to work with it as with an array, you need to convert it into an array.
You can convert into an array any object whose keys are cast to an integer type and have a length property that contains the index of the last element + 1.
Because testElements is not an array, it does not have a filter method. Array.prototype does not convert anything. It indicates that you need to refer to the filter method of the prototype of the Array constructor, and not the filter method of the testElements itself.
And this is the second part. call as the first argument takes the context in which the method will be executed (what will be this inside). So you say this line
Array.prototype.filter.call(testElements)
" Array.prototype the filter method from Array.prototype and call it on the testElements pseudo- testElements ."
By the way, similar behavior can be achieved as follows:
[].filter.call(testElements);
In this case, the interpreter will first look for the filter method on the object itself (the array), where it will not find it and continue to search for the __proto__ link, which points to the same Array.prototype . Still, the first option is preferable, because there is no initialization of the new array, even if empty.