6 kyu
Once
6,034 of 6,172osuushi
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 | 10889 |
Total Skips | 1681 |
Total Code Submissions | 68746 |
Total Times Completed | 6172 |
JavaScript Completions | 6034 |
CoffeeScript Completions | 157 |
Total Stars | 177 |
% of votes with a positive feedback rating | 87% of 316 |
Total "Very Satisfied" Votes | 251 |
Total "Somewhat Satisfied" Votes | 46 |
Total "Not Satisfied" Votes | 19 |