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.

javascript51_関数

Last updated at Posted at 2022-02-18

関数も一つのオブジェクトです。
そのため、オブジェクトの特性について関数は全部あります。
関数は後で呼び出されることはできます。

関数例:
var fun = new Function();
この書き方はほぼ使わない。
console.log(typeof fun);
結果としてfunctionが返される。

image.png
関数は呼ばれた時だけ実行される。
関数を呼ぶ方法: 関数対象()

*関数の一般的な書き方は下記です。
function 関数名(引数1,引数2....){
  処理;
}
image.png

*書き方3
var 関数名 = function(引数1,引数2...){
処理;
}

例:
var fun3 = function(){
console.log("私は匿名の関数です");
};
fun3();

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?