You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2015-04-03-left-variadic.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ title: Left-Variadic Functions in JavaScript
4
4
tags: JavaScript, noindex
5
5
---
6
6
7
+
[](https://www.flickr.com/photos/ekilby/7651165338"Football at Fenway Pregame Lineups (c) 2012 Eric Kilby")
8
+
7
9
A *variadic function* is a function that is designed to accept a variable number of arguments.[^eng] In JavaScript, you can make a variadic function by gathering parameters. For example:
8
10
9
11
[^eng]: English is about as inconsistent as JavaScript: Functions with a fixed number of arguments can be unary, binary, ternary, and so forth. But can they be "variary?" No! They have to be "variadic."
@@ -191,4 +193,4 @@ With `leftGather`, we have to supply the length of the array we wish to use as t
191
193
192
194
### summary
193
195
194
-
ECMAScript 2015 makes it easy to gather parameters or array elements from the right. If we want to gether them from the left, we can roll our own left-variadic decorator for functions, or left-gatherer for destucturing arrays.
196
+
ECMAScript 2015 makes it easy to gather parameters or array elements from the right. If we want to gather them from the left, we can roll our own left-variadic decorator for functions, or left-gatherer for destructuring arrays.
0 commit comments