Skip to content

Commit 87b8d4e

Browse files
committed
in place addition
1 parent 2cb2605 commit 87b8d4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

topics/about_control_structures.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ $(document).ready(function(){
88
if (2 > 0) {
99
isPositive = true;
1010
}
11-
equals(isPositive, __, 'what is the value of isPositive?');
11+
equals(isPositive, true, 'what is the value of isPositive?');
1212
});
1313

1414
test("for", function() {
1515
var counter = 10;
1616
for (var i = 1; i <= 3; i++) {
1717
counter = counter + i;
1818
}
19-
equals(counter, __, 'what is the value of counter?');
19+
equals(counter, 16, 'what is the value of counter?');
2020
});
2121

2222
test("for in", function() {
@@ -28,7 +28,7 @@ $(document).ready(function(){
2828
var result = "";
2929
// for in enumerates the property names of an object
3030
for (property_name in person) {
31-
result = result + property_name;
31+
result += property_name;
3232
};
3333
equals(result, __, 'what is the value of result?');
3434
});

0 commit comments

Comments
 (0)