const button = document.getElementById("btn");
const color = document.querySelector("#back");
const colors = ["#ff4242", "#004fd3",]
button.addEventListener("click", () => {
let hexColor = colors[getColorNumber()];
document.body.style.backgroundColor = hexColor;
color.style.backgroundColor = hexColor;
});
function getColorNumber() {
return Math.floor(Math.random() * colors.length);
}