DEV Community

Discussion on: JS: How to implement a Random Background Color Change to make your sites more professional

Collapse
 
klajdi44 profile image
Klajdi Ajdini

Nice, I would take a more modern approach to this and use const/let instead of var and use template literals instead of concatenating the values with +.

const  bgColor =  `rgb( ${x}, ${y}, ${z} )`;
Enter fullscreen mode Exit fullscreen mode