Slide 23
Slide 23 text
var num = "0"; // typeof(num) === "string"
if (num) {
console.log("1st");
}
num = num + 1; // typeof(num) === "string"
if (num) {
console.log("2nd");
}
num = num - 1; // typeof(num) === "number"
if (num) {
console.log("3rd")
}
Result:
"1st"
"2nd"