paint-brush
Once Upon a Time in Javascript: The const Keywordby@the_rock
1,319 reads
1,319 reads

Once Upon a Time in Javascript: The const Keyword

by Sasha3mJanuary 2nd, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Const was introduced in 2015 as part of ECMAScript 6 standard back in 2015. It is block-scoped but is used to define a constant value (obv) The fact that it is constant doesn't mean it is immutable, but a value its self remains mutable. If you want to create a completely immutable value you should use Object.freeze() before ES6. You can also use functions that always return the same value:.iateiate().iate() or create a "repository" using "immediately-invoked function expressions" (IIFE)

Coin Mentioned

Mention Thumbnail
featured image - Once Upon a Time in Javascript: The const Keyword
Sasha HackerNoon profile picture
Sasha

Sasha

@the_rock

Software Developer from monday to friday (Healthcare sector), Game Developer in free time

About @the_rock
LEARN MORE ABOUT @THE_ROCK'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Sasha HackerNoon profile picture
Sasha@the_rock
Software Developer from monday to friday (Healthcare sector), Game Developer in free time

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite