Olá!
Estou a fazer alguns exercícios para um bootcamp.
No exercício eles dão já os seguintes elementos:
var wizard = {
name: 'Harry Potter',
nickname: 'the boy who lived',
};
Depois pedem para: "Reassign the nickname property of the wizard object to have the value of ‘the chosen one’.
Finally, print the wizard object."
Eu fiz várias pesquisas em como atribuir novo valor ao objecto e todas eram semelhantes ao que produzi:
var wizard = {
name: 'Harry Potter',
nickname: 'the boy who lived',
};
wizard.nickname = 'the chosen one';
console.log(wizard.name+ ',' ,wizard.nickname);```
O output dá-me Harry Potter, the chosen one, mas continua a consola continua a dizer ">>>>Code is incorrect
Your program is producing the wrong output"
Alguém pode ajudar?
Obrigada