byexample

Values

JavaScript has various value types including strings, numbers, and booleans. Here are a few basic examples.

Strings, which can be added together with +.

console.log("hello " + "world");

Integers and floats.

console.log("1 + 1 =", 1 + 1);
console.log("7.0 / 3.0 =", 7.0 / 3.0);

Booleans, with boolean operators as you’d expect.

console.log(true && false);
console.log(true || false);
console.log(!true);