6 kyu
Once
6,049 of 6,187osuushi
Description:
You'll implement once
, a function that takes another function as an argument, and returns a new version of that function that can only be called once.
Subsequent calls to the resulting function should have no effect (and should return undefined
).
For example:
logOnce = once(console.log)
logOnce("foo") // -> "foo"
logOnce("bar") // -> no effect
Functional Programming
Fundamentals
Stats:
Created | Feb 22, 2014 |
Published | Feb 22, 2014 |
Warriors Trained | 10911 |
Total Skips | 1682 |
Total Code Submissions | 68780 |
Total Times Completed | 6187 |
JavaScript Completions | 6049 |
CoffeeScript Completions | 157 |
Total Stars | 177 |
% of votes with a positive feedback rating | 87% of 317 |
Total "Very Satisfied" Votes | 251 |
Total "Somewhat Satisfied" Votes | 47 |
Total "Not Satisfied" Votes | 19 |