Tell us what’s happening:
Trying to solve this one
And it gives me the following error
SyntaxError: unknown: Identifier ‘ownProps’ has already been declared (9:4)
But in the example, they did the same
So why does it error?
Your code so far
function Bird(name) {
this.name = name;
this.numLegs = 2;
}
let canary = new Bird("Tweety");
let ownProps = [];
// Only change code below this line
let ownProps = [];
for (let property in canary ) {
if(canary .hasOwnProperty(property)) {
ownProps.push(property);
}
}
console.log(ownProps);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
.
Challenge: Understand Own Properties
Link to the challenge: