Skip to content

Commit b17cfba

Browse files
committed
about_operators
1 parent 72e4c8d commit b17cfba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

topics/about_operators.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ test("addition", function() {
77
for (var i = 0; i <= 5; i++) {
88
result = result + i;
99
}
10-
equals(result, __, "What is the value of result?");
10+
equals(result, 15, "What is the value of result?");
1111
});
1212

1313
test("assignment addition", function() {
@@ -16,23 +16,23 @@ test("assignment addition", function() {
1616
//the code below is just like saying result = result + i; but is more concise
1717
result += i;
1818
}
19-
equals(result, __, "What is the value of result?");
19+
equals(result, 15, "What is the value of result?");
2020
});
2121

2222
test("subtraction", function() {
2323
var result = 5;
2424
for (var i = 0; i <= 2; i++) {
2525
result = result - i;
2626
}
27-
equals(result, __, "What is the value of result?");
27+
equals(result, 2, "What is the value of result?");
2828
});
2929

3030
test("assignment subtraction", function() {
3131
var result = 5;
3232
for (var i = 0; i <= 2; i++) {
3333
result -= i;
3434
}
35-
equals(result, __, "What is the value of result?");
35+
equals(result, 2, "What is the value of result?");
3636
});
3737

3838
//Assignment operators are available for multiplication and division as well
@@ -43,5 +43,5 @@ test("modulus", function() {
4343
var x = 5;
4444
//again this is exactly the same as result = result % x
4545
result %= x;
46-
equals(result, __, "What is the value of result?");
46+
equals(result, 0, "What is the value of result?");
4747
});

0 commit comments

Comments
 (0)