Math.random

const rnd = Math.random() * 10;

소수점 없애기

round

Math.round(1.7)

→ 반올림 → 2

ceil

Math.ceil(1.3)

→ 올림 → 2

floor

Math.round(1.7)

→ 내림 → 1

createElement

js 파일에서 html 생성

const bgImage = document.createElement("img");
bgImage.src = `img/${chosenImage}`;

body에 추가 시

document.body.appendChild(bgImage);

QUOTES 최종코드

BACKGROUND 최종코드