***
- **let**: Allows you to declare a variable with block scope (denoted by `{}`):
```js
let name = "John";
let sum = 100;
```
Using a `let` variable before [[JS - Hoisting | it is declared]] will result in a `ReferenceError`.
> [!INFO]- Difference between 'let' and 'var'
> Variables declared by `var` keyword are scoped to the immediate function body (hence the function scope). **The reason why `let` keyword was introduced to the language was function scope is confusing and was one of the main sources of bugs** in JavaScript.
- **const**: Allows you to declare a [constant](<https://eng.libretexts.org/Bookshelves/Computer_Science/Programming_and_Computation_Fundamentals/Programming_Fundamentals_(Busbee_and_Braunschweig)/02%3A_Data_and_Operators/2.01%3A_Constants_and_Variables>) (a JavaScript variable with a constant value):
```js
const API_URL = "https//api.test.com/v1"
```
***
**References**:
- [Javascript ES6](https://www.w3schools.com/Js/js_es6.asp#mark_let)
- [JavaScript Hoisting](https://www.w3schools.com/js/js_hoisting.asp)