diff --git a/rest-params.js b/rest-params.js index 7dcfa5a..0cc76d4 100644 --- a/rest-params.js +++ b/rest-params.js @@ -7,4 +7,11 @@ function foo(...x){ return x.length; } -foo(1, 2, 3, 4); // 4 \ No newline at end of file +foo(1, 2, 3, 4); // 4 + +function bar(...y) { + // y has all native array methods + return y.pop(); +} + +bar(1, 2, 3); // 3