Info
Open the page on your phone

What is the difference between let, var, and const

In JavaScript, 'let' and 'const' are block-scoped, while 'var' is function-scoped. 'let' allows re-declaration within the same scope, 'var' allows re-declaration, and 'const' does not allow re-assignment after declaration.

                        
let x = 10;
var y = 20;
const z = 30;