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 1 year has passed since last update.

コールバック関数

Posted at

コールバック関数とは....他の関数に引数としてワタさえる関数


関数
function hello(){     
    console.log('hello')
}

関数
function fn(cb) {
    cb();
}

fn(hello);  //hello

1. fn(hello); が実行されることで...
2. 関数のfncbにhelloが渡され
3.  関数の内部のcb();が実行され
4. 「 hello 」 となる




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?