Ankaj Gupta
March 01, 2019

var vs let vs const

JavaScript has 3-different keywords to declare a variable.

Example : var, let, and const

Let’s see the difference between var vs let vs const:

Keyword Scope Hoisting Can Be Reassigned Can Be Redeclared
var Function scope Yes Yes Yes
let Block scope No Yes No
const Block scope No No No
JavaScript

Join the discussion

Comments

0 comments

No comments yet — be the first to share your thoughts.

Related Posts