JavaScript types
A quiz about JavaScript types and their conversion.
Select the correct evaluation result
|
| |
| [x] | [ ] |
| [ ] | [x] |
| [x] | [ ] |
| [ ] | [x] |
Get it right!
Choose the returned value for each typeof
operator use cases. For example the first one would be executed as typeof "Hello"
and would return a "string"
.
|
|
|
|
|
|
|
|
| [ ] | [ ] | [ ] | [x] | [ ] | [ ] | [ ] |
| [ ] | [ ] | [ ] | [ ] | [ ] | [ ] | [x] |
| [ ] | [x] | [ ] | [ ] | [ ] | [ ] | [ ] |
| [x] | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] |
| [x] | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] |
| [x] | [ ] | [ ] | [ ] | [ ] | [ ] | [ ] |
| [ ] | [ ] | [ ] | [ ] | [ ] | [x] | [ ] |
| [ ] | [ ] | [ ] | [x] | [ ] | [ ] | [ ] |
| [ ] | [x] | [ ] | [ ] | [ ] | [ ] | [ ] |
| [ ] | [ ] | [ ] | [ ] | [x] | [ ] | [ ] |
How about trying it in the console of your browser?
What are the output values of the following expressions?
1 + 2
"1" + 2
+"1" + 2
1 + "2"
1+ +"2"
String always wins! ...unless it is turned to a number first.
Last updated