DEV Community

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

Collapse
 
jonrandy profile image
Jon Randy 🎖️

Try using syntax formatting on your posts (write javascript after the opening 3 backticks). Then it looks nice, like this:

const randomColor = `rgb(${[0,0,0].map(_=>~~(Math.random()*256)).join()})`
Enter fullscreen mode Exit fullscreen mode
Collapse
 
devlorenzo profile image
DevLorenzo

I just wrote an article on that if you're interested
dev.to/devlorenzo/js-why-we-should...