-1:000000000000 | 0:61c5ff7ff47a |
---|---|
1 // Array.of passes the number of arguments to the constructor it calls. | |
2 | |
3 var hits = 0; | |
4 function Herd(n) { | |
5 assertEq(arguments.length, 1); | |
6 assertEq(n, 5); | |
7 hits++; | |
8 } | |
9 Herd.of = Array.of; | |
10 Herd.of("sheep", "cattle", "elephants", "whales", "seals"); | |
11 assertEq(hits, 1); |