Understanding Var, Let and Const in JavaScript

There is more than one way to declare a variable in JavaScript, it uses the var, let and const keywords for variable declarations and they all behave differently. I will try to explain them and their different behaviors but before I do that, I would like to explain some concepts that you will come across in trying to understand the various variable declarations, these are Scope and Hoisting.

Scope -The scope of a variable or function is the part of the code where the variable is visible or accessible. So it simply means variable access, that is, what variables do…

Chris-Ugari Goodness

Front-end Developer. Addicted to personal development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store