title: Change background color randomly and automatically after 1 second (Javascript)
body: <p>I wanted to make an application which changes the background color after 1 second automatically. The below code does give out a random color at the start of the application, but it does not rerun and change color. The error I get is: rgb is not defined
      at :1:1</p>
  
  <p>HERE'S THE CODE: </p>
  
  <pre><code>function getRandomColor() { //To give me a new rgb number everytime
  return (Math.floor(Math.random() * (255 - 10)) + 10);
  }
  
  (function changeColor(){
      let color = `rgb(${getRandomColor()}, ${getRandomColor()}, ${getRandomColor()})`;
      console.log(color);
      setTimeout(document.body.style.background = color, 
          1000);
  })()    //used IIFE
  </code></pre>