Skip to content

Commit cd900d9

Browse files
committed
Create forEach sample.
1 parent 67ce531 commit cd900d9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

js/scratch-pad.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
return returnValue;
2020
};
2121

22+
Sample.forEachArray = [1, 3, 5, 9, 6, 19, 10, 11];
23+
Sample.forEach = function (x) {
24+
var sum = 0;
25+
for (var index in Sample.forEachArray) {
26+
sum += Sample.forEachArray[index];
27+
}
28+
return sum;
29+
};
30+
2231
return context.Sample = Sample;
2332

2433
Sample.hashAccess = {2: 'A', 6: 'B', 9: 'C', '2': 'D'}[val];

0 commit comments

Comments
 (0)