Josh Comeau 4/24/2023

The “const” Deception

Read Original

This article clarifies the common misconception that variables declared with JavaScript's 'const' keyword are completely immutable. It explains the crucial distinction between assignment (changing what a variable label points to) and mutation (changing the contents of the object itself), using clear examples to show why objects declared with 'const' can have their properties changed.

The “const” Deception

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet