Declare variables with the let
keyword.
let x = 10;
let y = "hello";
let isTrue = true;
5, 10, -20
"hello", "world"
true, false
[1, 2, 3]
{"key": "value"}
First-class functions
null
if (x > 5) {
return "greater";
} else {
return "less or equal";
}
let add = fn(a, b) {
return a + b;
};
add(5, 10); // Returns 15