We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
題目:
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:
function foo() { console.log('foo'); } fooOnce = once(foo) fooOnce() // -> "foo" fooOnce() // -> no effect
http://www.codewars.com/kata/5307ff5b588fe6d7000000a5/train/javascript
翻譯: 實現一個函數 once,它接受另一個函數作為參數,並返回該函數只能被調用一次的新版本。 所得到的函數的後續調用應該沒有任何效果(而且應該返回undefined) For example:
function foo() { console.log('foo'); } fooOnce = once(foo) // 把foo傳入once得到新函數fooOnce fooOnce() // -> "foo" (第一次調用fooOnce) fooOnce() // -> no effect (第二次以後調用fooOnce 沒有任何效果)
by Larry Huang
The text was updated successfully, but these errors were encountered:
PASS
Sorry, something went wrong.
pass
jawayang
No branches or pull requests
題目:
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:
http://www.codewars.com/kata/5307ff5b588fe6d7000000a5/train/javascript
翻譯:
實現一個函數 once,它接受另一個函數作為參數,並返回該函數只能被調用一次的新版本。
所得到的函數的後續調用應該沒有任何效果(而且應該返回undefined)
For example:
by Larry Huang
The text was updated successfully, but these errors were encountered: