Changed 'var' to 'let'
This commit is contained in:
@ -6,7 +6,7 @@ Use `Math.random` to generate a random number and limit that number to fall in b
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const randomHexColorCode = () => {
|
const randomHexColorCode = () => {
|
||||||
var color = '#';
|
let color = '#';
|
||||||
while(color.length < 7) color += '0123456789ABCDEF'[Math.floor(Math.random() * 16)];
|
while(color.length < 7) color += '0123456789ABCDEF'[Math.floor(Math.random() * 16)];
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user