What are the types of the following expressions and what do they evaluate to, and why?
17number, 171 + 2 * 3 + 411, typeof nummber800 / 80 / 81.25 , number400 > 200true, boolean1 !== 1false, booleantrue || falsetrue, if there one truth in || (or), it will be truthtrue && falsefalse, boolean20 % 62, number'a' + 'b'ab, string
What will the following return?
typeof 4numbertypeof 'hello'stringtypeof trueboolean2 === 1 || 3 === 4false , boolean
Create a truth table for the expression A || B.
For reference, here is a truth table for the expression A && B:
| A | B | A && B |
|---|---|---|
| true | true | true |
| false | true | false |
| true | false | false |
| false | false | false |
| A | B | A || B | |-------|-------|--------| | true | true | true | | false | true | true | | true | false | true | | false | false | false |
Create a truth table for the expression !A && !B.
For reference, here is a truth table for the expression A && !B:
| A | B | !B | A && B |
|---|---|---|---|
| true | true | false | false |
| false | true | false | false |
| true | false | true | true |
| false | false | true | false |
| A | B | !B | !A | !A && !B | |-------|-------|--------|--------| | true | true | false | false | False | false | true | false | true | false | true | false | true | false | false | false | false | true | true | True
Create a truth table for the expression !(A || B).
| A | B | A || B | !(A || B) | | True | True | True | False | | True | False | True | False | | False | True | True | False | | False | False | False | True |
Write a step-by-step evaluation for the following expression (remember order of operations): 2 + 3 * 2 + 1.
For reference, here is a exp of a step-by-step evaluation:
1 + 2 + 3 + 4
3 + 3 + 4
6 + 4
10-> 2 + 6 + 1 -> 8 + 1 -> 9
Write a step-by-step evaluation for the following expression (remember order of operations): 4 / 2 + 8 / 4.
-> 2 + 2 -> 4
Write a step-by-step evaluation for the following expression: 'ca' + 'ter' + 'pi' + 'llar'.
"cater" + "pi" + "llar" "Caterpi" + "llar" "Caterpillar"
Write a step-by-step evaluation for the following expression: 2 * 4 === 8 && 'car' + 'pool' === 'carpool'.
-> 8 === 8 && "car" + "pool" === "carpool" -> 8 === 8 && "carpool" === "carpool"
Write a step-by-step evaluation for the following expression: '1' + '2' + '3' - '1'.
-> 12 + 2 -> 14