Files
30-seconds-of-code/snippets/join_array_like_objects.md
2017-12-13 21:42:58 +05:30

12 lines
283 B
Markdown

### Joining an array-like object
The following example joins array-like object (arguments), by calling Function.prototype.call on Array.prototype.join.
```
function f(a, b, c) {
var s = Array.prototype.join.call(arguments);
console.log(s); // '1,a,true'
}
f(1, 'a', true);
```