411 REFERENCE · Wikibooks
JavaScript/Operators/Exercises
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
Topic: Operators
{What is the result?
|type="()"}
| 7 | 9 | 16 | 123
+--- 1 + 2 * 3
+--- 1 + "2" * 3
--+- "1" + "2" * 3
{What is the result?
|type="()"}
| 0 | 1 | 1.5 | 4 | 12 | 13.5
---+-- 1 + 2 ** 3 / 2 - 1
+ 9 / 2 * 3
--+--- 9 / (2 * 3)
{What is the result?
|type="()"}
| 0 | 1 | 2
--+ x = 1; x++; alert(x);
--+ x = 1; alert(++x);
-+- x = 1; alert(x++);
{What is the result?
|type="()"}
| true | false
+- 1 == 01
+- 1 === 01
+- "1" == 01
-+ "1" == "01"
+- "1" == 0 + 1
-+ "1" == 0 + "1"
-+ "1" == 0 * 1
-+ "1" == 0 * "1"
{What is the result?
|type="()"}
| true | false
-+ true && false
+- true && false || true
-+ true && false || !true
+- !(true && false)