I want to create a random color-picker with javascript and for that, I want random hex codes. The part with getting the hex codes is done but they appear as strings on different lines when I use console.log(); and not as one string on one line.
Does someone know how to change it? I already tried to set it as an array but it still appears on different lines because I used a for-loop and I can't change the name of the different strings because of that. Sorry for my poor explanation but here is the code for you to run it and maybe help me out:
let hexDigits = ["A", "B", "C", "D", "E", "F",
"1", "2", "3", "4", "5", "6", "7", "8", "9"
];
for (let i = 0; i < 6; i++) {
let hexColor = hexDigits[Math.floor(Math.random() * hexDigits.length)];
console.log(hexColor);
}