Skip to content

Commit aa278b9

Browse files
author
FOUNDATIONSOFT\AHunter
committed
fcns and closures
1 parent 4248230 commit aa278b9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

topics/about_functions_and_closure.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ test("arguments array", function () {
3838
var total = 0;
3939
for (var i = 0; i < arguments.length; i++) {
4040
// complete the implementation of this method so that it returns the sum of its arguments
41-
// __
41+
total += arguments[i];
4242
}
43-
// __
43+
return total;
4444
};
4545

4646
equal(15, add(1, 2, 3, 4, 5), "add 1,2,3,4,5");
@@ -58,7 +58,7 @@ test("using call to invoke function", function () {
5858
//function, and the arguments to be sent to the function,multiple arguments are separated by commas.
5959
var result = invokee.call("I am this!", "Where did it come from?");
6060

61-
equal(__, result, "what will the value of invokee's this be?");
61+
equal("I am this!Where did it come from?", result, "what will the value of invokee's this be?");
6262
});
6363

6464
test("using apply to invoke function", function () {
@@ -71,5 +71,5 @@ test("using apply to invoke function", function () {
7171
//function and the second is the array of arguments to be passed into the called function.
7272
var result = invokee.apply("I am this!", ["I am arg1", "I am arg2"]);
7373

74-
equal(__, result, "what will the value of invokee's this be?");
74+
equal("I am this!I am arg1I am arg2", result, "what will the value of invokee's this be?");
7575
});

0 commit comments

Comments
 (0)