Files
30-seconds-of-code/test/randomHexColorCode/randomHexColorCode.js
2018-08-02 13:49:33 +03:00

6 lines
165 B
JavaScript

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