Difference Between Var, Let and Const in ES6

The Difference with Handy examples

Solazzo Nicola
Nov 5 · 3 min read
Photo by Franck V. on Unsplash
Photo by Franck V. on Unsplash
Photo by Franck V. on Unsplash

The differences between these three variables made me confused when I started to use ECMAScript 6. The most confusing was to understand the difference between let and var.

So let’s try to explain this difference.

var a = 'I am var';
const b = 'I am const';
let c = 'I am let';

Solazzo Nicola

Written by

Full-stack developer Javascript for Starteed.com

NotOnlyCSS

This publication includes original articles and tips about frontend technologies.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade