Understand Own Properties issue

Understand Own Properties issue
0

#1

Tell us what’s happening:

not passing “Solve this challenge without using the built in method Object.keys().”

Your code so far
ownProps = Object.keys(canary).filter((elem) => canary.hasOwnProperty(elem));


function Bird(name) {
  this.name = name;
  this.numLegs = 2;
}

let canary = new Bird("Tweety");
let ownProps = [];
// Add your code below this line
ownProps = Object.keys(canary).filter((elem) => canary.hasOwnProperty(elem));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/understand-own-properties/


#2

That’s because you are using Object.keys(), which the challenge specifically tells you not to do.


#3

Buh, i read with instead without. also "Object.keys() returns an array whose elements are strings corresponding to the enumerable properties found directly upon object. " so filter no need