Files
30-seconds-of-code/test/randomHexColorCode/randomHexColorCode.js
2018-01-30 20:16:28 +00:00

5 lines
159 B
JavaScript

const randomHexColorCode = () => {
let n = (Math.random() * 0xfffff * 1000000).toString(16);
return '#' + n.slice(0, 6);
};
module.exports = randomHexColorCode