I need help with this, is there any simpler way to write this code.
I would like the object value to be returned inside the paragraph, instead of just in the console. PLEASE.
exercise:
I need help with this, is there any simpler way to write this code.
I would like the object value to be returned inside the paragraph, instead of just in the console. PLEASE.
exercise:
Hi @Phellipe_ferreira and welcome to the community
You could change your greeting()
function to
return `Hello, said ${ this.name } the ${ this.breed }.`;
Then you will be able to use the following to print the return value to the paragraph:
para.textContent = cat.greeting();
para2.textContent = cat2.greeting();
I hope that helps. Please tell me if you need more help.
Happy coding,
Michael
Thank you my friend!
It helped me a lot, Iโm going to study and pratice more to get as good as you.
Youโre welcome
Thatโs the right attitude. We need to constantly learn. Itโs the same for both of us.