Sign in
cobalt
/
cobalt
/
71840339e1109efe930df5c60712d91cdcc962a8
/
.
/
src
/
third_party
/
mozjs-45
/
js
/
src
/
jit-test
/
tests
/
basic
/
testArrayPushPop.js
blob: 8e00dad231b18e24df861e0779703bef44545959 [
file
] [
log
] [
blame
]
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"
);