//const object properties or array values can be updatedconstfriends=[{name:'Bob 🥽',age:22,hobby:'golf🏌',music:'rock 🎸'}];constresult=friends.age=23;console.log(result);//output => 23
does not update the original age (I guess the code was intended to update age from 22 to 23, right?). Instead it creates a new named property of the array object:
I am a User Interface Designer learning web development. I don't know what I am doing but I am trying my best to grow as a self taught developer.
Welcome to my newbie tech journey.👩💻
@tracycss thank you for the great article :)
This snippet
does not update the original age (I guess the code was intended to update
age
from 22 to 23, right?). Instead it creates a new named property of the array object:This can be checked:
To update the original
age
:Great input Max, I might the values or properties can be changed. Let me update that part.
Thank you. 💯🌟🙂