What are the types of the following pieces of data: "", 0, 1, "0", "1", [], {}, null, undefined, NaN, Infinity, console, console.log, document, document.write, true, false.
For the five elementary arithmetic operations (-, +, *, /, %), when given two strings like "2" and "5", or one string and one number, like "2" and 5 or 2 and "5", what are the results?
Is 10 + 5 % 2 the same as (10 + 5) % 2, or 10 + (5 % 2)? How about 10 * 5 % 2?
| Order of Operations |
Result |
|
|
|
|
|
|
|
|
Is 0 == 1 ? "fish" : "duck" the same as (0 == 1) ? "fish" : "duck", or 0 == (1 ? "fish" : "duck")?
| Order of Operations |
Result |
| 0 == 1 ? "fish" : "duck" |
|
| (0 == 1) ? "fish" : "duck" |
|
| 0 == (1 ? "fish" : "duck") |
|
Which of these values are truthy and which are falsy: 0, 1, 2, "0", "1", "2", "cow", "", null, undefined, NaN, Infinity, [], [0], {}, {vegetable: "cabbage"}.
What are the return results from the following expressions: "dog" || "cat" || "cow"; "dog" && "cat" && "cow".
| Short Circuit Evaluation |
Result |
| "dog" || "cat" || "cow" |
|
| "dog" && "cat" && "cow" |
|