0
0

More than 3 years have passed since last update.

[Javascript]関数

Posted at

関数定義

const 定数名 = function() {
処理
};

const hello = function() {
  console.log("こんにちは");
}

アロー関数

function ()の代わりに () =>

const hello = () => {
  console.log("こんにちは");
}

関数呼び出し

定数名();

const hello = function() {
  console.log("こんにちは");
}

hello();

戻り値とその呼び出し

const sum = (a , b) => {
  return a + b;
}

const price = sum(100 , 300);
console.log(price);

出力結果
400

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