'#'+Math.floor(Math.random()*16777215).toString(16);
const randomHex = () => `#${Math.floor(Math.random() * 0xffffff).toString(16).padEnd(6, "0")}`;
console.log(randomHex());
// Result: #92b008
const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
console.log(genRanHex(6));
console.log(genRanHex(12));
console.log(genRanHex(3));
"#" + ((1<<24)*Math.random() | 0).toString(16));
var randomColor = "#000000".replace(/0/g,function(){return (~~(Math.random()*16)).toString(16);});