Values Example


Concatenate strings with +
console.log("TypeScript" + "rocks")               // TypeScriptrocks

console.log(3 + 5)                                // 8

Cast an integer to string
console.log("3 + 5 = " + String(3 + 5))           // 3 + 5 = 8

console.log(1.0 / 3.0)                            // 0.3333333333333333

console.log(String(1.0) + " / " + String(3.0))    // 1 / 3

Booleans in TypeScript
console.log(true && false)                        // false

console.log(!false)                               // true

console.log(true || false)                        // true