JavascriptVariables in JavaScript

Variables store data. In modern JavaScript, use:

  • let: can be updated
  • const: constant, can't be reassigned
  • var: old way, avoid using it
let name = \"John\";
const age = 25;
var oldWay = true;

console.log(name, age);