var, let and const — What, why and how — ES6 JavaScript Features

Mattias Petter Johansson
Fun Fun Function
Published in
1 min readJul 11, 2016

In ES5, we only had one type of variable, var, but in ES6, we have three. types of variables: var, let and const. In this video, we explore the what, why, and how of var, let and const, and I also do a little lecture on the value of minimising mutable state. Video below:

► 00:35 var keyword in JavaScript
► 02:35 Immediately-Invoked Function Expression (IIFE) in JavaScript
► 03:14 hoisting variables in JavaScript
► 08:29 let keyword in JavaScript
► 11:55 const keyword in JavaScript
► 14:14 Minimize mutable state when programming

I’m also active on:
- Twitter https://twitter.com/mpjme
- Medium https://medium.com/@mpjme
- Quora https://www.quora.com/profile/Mattias-Petter-Johansson

Resources:

- Semicolons cannot save you! (Another funfunfunction video)
https://www.youtube.com/watch?v=Qlr-FGbhKaI&index=11&list=PL0zVEGEvSaeH21VDycWYNWU7VKUA-xLzg

- ES6 JavaScript Features (Playlist of this series)
https://www.youtube.com/watch?v=ategZqxHkz4&index=1&list=PL0zVEGEvSaeHJppaRLrqjeTPnCH6vw-sm

--

--

Mattias Petter Johansson
Fun Fun Function

Creator of Fun Fun Function, a YouTube show about programming.