What are the types of the following expressions and what do they evaluate to, and why?
17// number because its not a letter1 + 2 * 3 + 411 because of pemdas800 / 80 / 81.25400 > 200Boolean becauee True1 !== 1falsetrue || falseTrue, because true is present it is truetrue && falseFalse because a true can not be false20 % 6It a number, the answer is 2 because that is the remainder'a' + 'b'ab , its a string, it will place together because of the add sign
What will the following return?
typeof 4numbertypeof 'hello'stringtypeof truestring2 === 1 || 3 === 4false
Create a truth table for the expression A || B
| 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
| A | B | !B | A && B |
|---|---|---|---|
| true | true | false | false |
| false | true | false | false |
| true | false | true | true |
| false | false | true | false |
Create a truth table for the expression !(A || B)
| !A | !B | A || B | !A || B| |-------|-------|---------|--------| | true | true | true | false | | false | true | true | false | | true | false | true | false | | false | false | false | true |
Write a step-by-step evaluation for the following expression (remember order of operations): 2 + 3 * 2 + 1.
2 + 3 * 2 + 1
->2 + 6 + 1
-> 8 + 1
->9
Write a step-by-step evaluation for the following expression (remember order of operations): 4 / 2 + 8 / 4.
4 / 2 + 8 / 4
-> 2 + 8 / 4
-> 2 + 2
-> 4
Write a step-by-step evaluation for the following expression: 'ca' + 'ter' + 'pi' + 'llar'.
'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'.
2 * 4 === 8 && 'car' + 'pool' === 'carpool'
-> 8 === 8 && 'car' + 'pool' === 'carpool'
--> true && 'car'+ 'pool' === 'carpool'
---> true && 'carpool' === "carpool'
----> true && true
-----> true
Write a step-by-step evaluation for the following expression: '1' + '2' + '3' - '1'.
'1' + '2' + '3' - '1'
-> 12 + '3' - '1'
--> 123 - '1'
---> 122