Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

概要

最近の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

ksyunnnn
ハイパー新人プログラマ
https://medium.com/@ksyunnnn
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away