Can pass the challenge but having trouble understanding what purpose “let” serves in the for loop.
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
for (let property in canary) {
if (canary.hasOwnProperty(property)) {
ownProps.push(property);
}
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36.
Rather than trying to re-explain the wheel, here’s a link that seems to do a good job:
Bottom line: Always use let or const to declare variables. Most people will tell you to always start with const and then change it to let if the value needs to change. But there are some obvious cases where you will always use let (such as a counter in a for loop).