LoginSignup
3
1

More than 5 years have passed since last update.

「execFunc()()」を見て「ふぁっ??」っとなった時のメモ

Last updated at Posted at 2018-02-14

概要

最近のJavaScript?はexecFunc()()みたいな感じで、かっこかっこ言ったりしてます。よくわかりません。

関数で関数を返すことができるのでこんな感じで書けるらしい。 参考

const callFunction = () => {
    return (text) => {
        console.log(`text is ${text}`)
    }
}
>callFunction()("is this text?")

=> text is is this text?

参考

JavaScriptを読んでて「なにこれ!?」と思うけれど調べられない記法8選。 - Qiita
イマドキのJavaScriptの書き方2018 - Qiita

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1