0
0

スプレッド構文について

Posted at

スプレッド構文とは

  • 配列の値を展開する
  • 引数を配列として取得する

を行うことができる。

今回は展開するパターンの例

const a = [1,2,3,4,5]
const max = Math.max(...a)
console.log(max)

Math.maxメソッドは複数の値から最大を返すメソッド。
https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/Math/max
一つ一つ設定すると大変なので、配列を...で展開するのがスマート

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