There are two ways to declare variables in JavaScript: var and let. var declares a function-scoped variable (when declared within a function) Let and const declare block- scoped variables. With let and const, you won't be able to use a variable that has not been declared.
Table of contents
const and let Keywords to Declare Variables1 Comment
Sort: