generate random hex js code example
Example 1: js random hex color
'#'+Math.floor(Math.random()*16777215).toString(16);
Example 2: random color in javascript
var randomColor = Math.floor(Math.random()*16777215).toString(16);
Example 3: random hexadecimal character js
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));