LoginSignup
1
0

More than 1 year has passed since last update.

Promiseの基本

Posted at

基本

//最初は待っててね状態
new Promise(() => {});

//resolveすると完了状態
new Promise(resolve => resolve());

//完了時の値をthenでつないで次に渡せる
new Promise(resolve => resolve('こんにちは'))
.then(res => console.log(res));

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