j2s/tests/array/pop.js

8 lines
288 B
JavaScript
Raw Normal View History

2024-01-06 15:49:36 +00:00
return new UnitTest('pop', function() { return typeof Array.prototype.pop === 'function'; })
.add('simple pop', function() {
var arr = [1, 2, 3];
return match(3, arr.pop())
})
.add('pop from empty', function() {
return match(undefined, [].pop())
})