LoginSignup
4
1

More than 5 years have passed since last update.

アロー関数の引数にjsdocで型を指定する

Posted at

WebStormでアロー関数の引数に型を指定して、入力補完を効かせる方法です。

以下のように引数の前に/** type */ を指定すれば入力補完を有効にできます。

[].forEach(/**Number*/num1 => {
    return num1 * num1;
});

参考
https://stackoverflow.com/questions/35112415/jsdoc-arrow-function-params

4
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
4
1