0
0

More than 1 year has passed since last update.

javaScript82_Math

Posted at

Mathは構造関数ではない。
Mathはツールに属し、中には数学に関する計算方法と属性などが入っています。
そのため、Mathを使う時に、新しいオブジェクトを作る必要はありません。
直接使うことができます。
注意:大文字で書いた属性は全部変わらない値です。例:PI
console.log(Math.PI);

abs()は数値の絶対値を計算することができる。
console.log(Math.abs(-1));
結果は1になります。

Math.ceil()
image.png
Math.floor()
image.png
Math.round()
image.png
Math.random()
image.png
Math.Max(),Math.Min(),Math.pow(),Math.sqrt()
image.png

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