6.0 ~ 6.2
Math.ceil()
소수자리가 있으면 무조건 올림
Math.round()
반올림
Math.floor()
소수자리 버림, 정수 유지
Math.random()
0과 1사이의 랜덤숫자
* 숫자
를 해주면 0부터 해당숫자 사이의 랜덤숫자가 나온다.
ex) Math.random() * 5. => 0과 5사이의 랜덤숫자
const images = ["0.jpeg","1.jpeg","2.jpeg"];
images [Math.floor(Math.random() * images.length )]
createElement()
와 appendChild()
로 html에 태그를 추가할 수 있다. 변수 = document.createElement("태그")
document.body.appendChild(변수)