DEV Community

Discussion on: Solving "Wherefore art thou" / freeCodeCamp Algorithm Challenges

Collapse
 
brian87370205 profile image
BrnkecZgDug

Hey, quick question .. (bear with me as i'm still learning) ...

I have console.logged this line so many times and it always returns false ...
obj.hasOwnProperty(sourceKeys[i]), and since you have a ! in front of it, it would make it true. It's console logging an array which and not the actual keys in the array. Wouldn't the "obj" need to have a obj[0] in front of it for the hasOwnProperty() method to work ?!
And my second question is, arr = collection.filter(function(obj) .. how does javascript know that the obj value is the array collection ?!

Everything else i understand and thankful for your help!

Collapse
 
sourdragon profile image
Adithya Ds

I have the same doubts. Did you figure it out if you did let me know.