blob: 8e00dad231b18e24df861e0779703bef44545959 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
function testArrayPushPop() {
var a = [], sum1 = 0, sum2 = 0;
for (var i = 0; i < 10; ++i)
sum1 += a.push(i);
for (var i = 0; i < 10; ++i)
sum2 += a.pop();
a.push(sum1);
a.push(sum2);
return a.join(",");
}
assertEq(testArrayPushPop(), "55,45");
|