var is globally scoped and hoisted, which can lead to unintended side effects.
let is block-scoped and can never be redeclared within that scope – much harder to break, but need to be careful about passing it to where it's needed and aware that it is still hoisted, albeit with no value (not even null).
const works similarly to let, but you cannot update the value (though you can update internal values).
- Link to Original 🔗
- 16 June 2020
Explore Other Notes
The React cheatsheet for 2020
A very hand overview of the core concepts in React, from JSX to fragments to hooks. Includes quick reference to the core hooks and how/when to use them e.g. useState, useContext, useMemo […]
Images good to the last byte
An exhaustive guide to image optimisation, compression, formats, and quality on the […]