基本
qiita motto.js
val = num1 + num2;
val = num1 * num2;
val = num1 - num2;
val = num1 / num2;
val = num1 % num2;
qiita motto.js
//pi
val = Math.PI;
//Napier's constant
val = Math.E;
//2 四捨五入
val = Math.round(2.4);
//3 切り上げ
val = Math.ceil(2.4);
//2 切り捨て
val = Math.floor(2.8);
//8
val = Math.sqrt(64);
// 絶対値
val = Math.abs(-3);
val = Math.pow(8, 2);
// 最小値のみ出力
val = Math.min(2,33,4,1,55,6,3,-2);
val = Math.max(2,33,4,1,55,6,3,-2);
val = Math.random();
1~20の範囲でランダムに出力
qiita motto.js
val = Math.floor(Math.random() * 20 + 1);