Quiz Flashcards
1
Q
5 + “34”
A
534
2
Q
5 - “4”
A
1 *This occurs because js can add strings together for eg.) “hello” + “world” would be “helloworld” but you can’t subtract a string from a string. “hello” - “bye” would result in a NaN.
So js converts the stringed number into a number whereas when you’re adding a number to a stringed number, js would convert the number into a string.
3
Q
10 % 5
A
0
4
Q
5 % 10
A
5
5
Q
” “ + “ “
A
” “
6
Q
” “ + 0
A
” 0”
7
Q
3 - 4
A
-1
8
Q
“bob” - “bill”
A
NaN
9
Q
5 >= 1
A
true
10
Q
0 === 1
A
false
11
Q
4 <= 1
A
false
12
Q
1 != 1
A
false
13
Q
“A” > “B”
A
false
14
Q
“B” < “C”
A
true
15
Q
“a” > “A”
A
true