Instead of presuming, look at the documentation. What does that function return? Does it make sense as an input for hasOwnProperty()? What argument does hasOwnProperty() expect?
You’re a little confused. Hope I’m able to clear your doubts.
The collector function accepts three arguments:
value: The current value in the iteration
index: the current index of the current value in the iteration
array: the entire collection itself
You don’t have to run a loop here
The individual elements are available in the value property
I have not taken this test. But the if condition here is definitely wrong.
You are trying to compre an array to a string.
Object.keys returns an array of keys belonging to the ‘source’ object.
hasOwnProperty accepts only a string/symbol in its parameter