Travis build: 840 [ci skip]
This commit is contained in:
@ -6,7 +6,8 @@ Utilizing a closure, use a flag, `called`, and set it to `true` once the functio
|
||||
Allow the function to be supplied with an arbitrary number of arguments using the spread (`...`) operator.
|
||||
|
||||
```js
|
||||
const once = fn => (called => (...args) => !called ? (called = true, fn(...args)) : undefined)()
|
||||
const once = fn =>
|
||||
(called => (...args) => (!called ? ((called = true), fn(...args)) : undefined))();
|
||||
```
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user