11
2+
23module ( "About Operators (topics/about_operators.js)" ) ;
34
45test ( "addition" , function ( ) {
@@ -7,7 +8,7 @@ test("addition", function() {
78 for ( var i = 0 ; i <= 5 ; i ++ ) {
89 result = result + i ;
910 }
10- equals ( result , __ , "What is the value of result?" ) ;
11+ equals ( result , 15 , "What is the value of result?" ) ;
1112} ) ;
1213
1314test ( "assignment addition" , function ( ) {
@@ -16,23 +17,23 @@ test("assignment addition", function() {
1617 //the code below is just like saying result = result + i; but is more concise
1718 result += i ;
1819 }
19- equals ( result , __ , "What is the value of result?" ) ;
20+ equals ( result , 15 , "What is the value of result?" ) ;
2021} ) ;
2122
2223test ( "subtraction" , function ( ) {
2324 var result = 5 ;
2425 for ( var i = 0 ; i <= 2 ; i ++ ) {
2526 result = result - i ;
2627 }
27- equals ( result , __ , "What is the value of result?" ) ;
28+ equals ( result , 2 , "What is the value of result?" ) ;
2829} ) ;
2930
3031test ( "assignment subtraction" , function ( ) {
3132 var result = 5 ;
3233 for ( var i = 0 ; i <= 2 ; i ++ ) {
3334 result -= i ;
3435 }
35- equals ( result , __ , "What is the value of result?" ) ;
36+ equals ( result , 2 , "What is the value of result?" ) ;
3637} ) ;
3738
3839//Assignment operators are available for multiplication and division as well
@@ -43,5 +44,5 @@ test("modulus", function() {
4344 var x = 5 ;
4445 //again this is exactly the same as result = result % x
4546 result %= x ;
46- equals ( result , __ , "What is the value of result?" ) ;
47+ equals ( result , 0 , "What is the value of result?" ) ;
4748} ) ;
0 commit comments