var x = 10;
let y = "Hello";
const z = true;
- The "var" keyword is used to declare a variable with function scope, meaning it is accessible within the function it was declared in and its nested functions.
- The "let" keyword is used to declare a variable with block scope, meaning it is only accessible within the block it was declared in and its nested blocks.
- The "const" keyword is used to declare a constant variable, meaning its value cannot be changed once assigned.