Patterns and Anti-patterns in Node.js
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.