Removed unnecessary OR in randomHexColorCode()

This commit is contained in:
Oscar Shrimpton
2018-01-29 19:39:33 +00:00
parent b716781f8d
commit 023bac915d

View File

@ -6,7 +6,7 @@ Use `Math.random` to generate a random 24-bit(6x4bits) hexadecimal number. Use b
```js ```js
const randomHexColorCode = () => { const randomHexColorCode = () => {
let n = (((Math.random() * 0xfffff) | 0) << 6).toString(16); let n = (((Math.random() * 0xfffff)) << 6).toString(16);
return '#' + n.slice(0, 6); return '#' + n.slice(0, 6);
}; };
``` ```