Hi coders,
I was practicing in object in JS and I want to insert into my object a function that print my properties, but the compiler give me an error that species is not defined.
This is my code:
let bird = {
name: 'Falcon',
species: "predatory",
age: 2,
address: "Mountain Rock",
tweet: function(){
console.log("Aaaaa --ooohh");
},
describe: function(){
console.log(name + species + age + address); // gives me an error!!
}
}
bird.tweet()
bird.describe()
I ask also how to print my properties that add me to the console.log of commas for each property ( I was thinking about use join() but I don’t know if It’s correct).
Thanks,
CamCode