Hello. Can you pls take a look at my code. It seems ok except that I get an undefinded
after calling the method and I dont understand why.
Thank you
Hello. Can you pls take a look at my code. It seems ok except that I get an undefinded
after calling the method and I dont understand why.
Thank you
Hello @brusli
const cat = {
name : 'Bertie',
breed : 'Cymric',
color : 'white',
greeting: function() {
console.log(`Hello, said ${this.name} the ${this.breed}.`);
}
}
console.log(cat.greeting()); //console.log expect something to print like string or object but cat.greeting() function does not return any thing so you can call it like that
cat.greeting();
fix the other 3 same issue and you done
check this for more info about console.log
hope that help and have a nice day