Difference between let, var and const in JavaScript with Hoisting

var should be globally scoped.

let should be a function or block scoped.

const should be used with read-only values or computed values, generally inside a component.