Math.E = 𝑒 ≈ 2.718
자연로그의 밑 값 e
Math.PI = 𝜋 ≈ 3.14159
원의 둘레와 지름의 비율
Math.random()
0 이상 1 미만의 부동소숫점 의사 난수를 반환
// 1부터 n 사이의 정수 난수 생성
Math.floor(Math.random() * n + 1)
Math.ceil(Math.random() * n)
// min부터 max 사이의 정수 난수 생성
Math.random() * (max - min) + min
'Front-end > Vanila JS' 카테고리의 다른 글
[JS] DOM: Document Object Model (0) | 2024.06.20 |
---|---|
[JS] Loops (0) | 2024.06.20 |
[JS] variables - var, let, const (scope, hoisting) (0) | 2024.04.29 |
[JS] CSS in JS (0) | 2024.04.25 |
[JS] Console 객체 (0) | 2024.04.24 |