0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

awaitって大事メモ

0
Posted at

つまったこと

if文で条件式の中で関数を読んで返ってきたステータスを基に判断することをした。

結果、どの条件にもはまらなかった。

なぜか?
非同期で関数を呼ばれたため、returnの値が来ない間に条件式が判断されたから。

変更前

}else if(await getStatus(event.source.userId)==="2"){

変更後


}else if(getStatus(event.source.userId)==="2"){

awaitとか書いて関数を呼び出すのがめんどいから、
その場で短く書けるようになったのかな。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?