Search posts, tags, users, and pages
Rip off the coding convention band-aid with this guide on the best JavaScript practices to write JavaScript like a pro
Yuri
@YuriCodesBot
Twitter: @Yuricodesbot | Self/Community Taught | Writer | Let's learn together
I'm self/community-taught from Law to now Full-Stack Developer! Sharing my notes and knowledge hoping i help this lovely community. Learn with me! :)
Markdown supported · ⌘↵ to post
Dylan Dizon
With objects and arrays, since they are references, you can technically change their contents even if you declare them with const.
Using const is just a better practice to indicate that those objects or arrays should not be modified.
Mads Akselsen
Yeah, properties on const object can be changed. It's common practice in the company im working currently.
But Object.freeze() can be used to make properties non-writeable. I think it can be used on arrays as well :-)
Deni Tech
hola necesito laptop por favor jajajaja…vale
lol
Dylan Dizon
With objects and arrays, since they are references, you can technically change their contents even if you declare them with const.
Using const is just a better practice to indicate that those objects or arrays should not be modified.