paint-brush
Why You Shouldn’t Use ‘var’ Anymoreby@markbrouch
27,323 reads
27,323 reads

Why You Shouldn’t Use ‘var’ Anymore

by Mark Brouch3mOctober 17th, 2016
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

I’ve been writing JavaScript using the ES2015 (ES6) syntax for awhile now and have grown to appreciate many of the language changes for their elegance and simplicity. One of the first and easiest changes I adapted to was using <code class="markup--code markup--p-code">let</code>/<code class="markup--code markup--p-code">const</code> instead of <code class="markup--code markup--p-code">var</code>. However, I took for granted the benefit <code class="markup--code markup--p-code">let</code> provides over <code class="markup--code markup--p-code">var</code>; it isn’t just a flashy new syntax for <code class="markup--code markup--p-code">var</code>, but rather provides an important scoping mechanism.

Company Mentioned

Mention Thumbnail
featured image - Why You Shouldn’t Use ‘var’ Anymore
Mark Brouch HackerNoon profile picture
Mark Brouch

Mark Brouch

@markbrouch

L O A D I N G
. . . comments & more!

About Author

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