LoginSignup
0
0

More than 5 years have passed since last update.

自分メモ:関数の配列

Posted at

配列の中に関数を作って呼び出せる。

sample.js

var functions = [
  function(){
    console.log('0番目の関数');
  },
  function(){
    console.log('1番目の関数');
  },
  function(){
    console.log('2番目の関数');
  }
];
functions[0]();

今のところぱっと使い所が思い浮かばないけど知らなかったのでメモ。

0
0
2

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