JavaScript function does not work. Help a newbie :\ : <p>I'm working on a linear gradient generator.
I wanted to add a random gradient function, so it picks the background style and sets a gradient with two random colors. Everything worked until i added this random function. It looks like this:</p>

<pre><code>function getRandomInRange(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
}

function setRandomGradient() {
    body.style.background = "linear-gradient(to right, rgb("
    + (getRandomInRange(1, 255)
    + " ,"
    + (getRandomInRange(1, 255)
    + " ,"
    + (getRandomInRange(1, 255)
    + "), rgb("
    + (getRandomInRange(1, 255)
    + " ,"
    + (getRandomInRange(1, 255)
    + " ,"
    + (getRandomInRange(1, 255)
    + "))";
}
</code></pre>

<p>getRandomInRange works well, but setRandomGradient isn't working and console shows me an error like:</p>

<blockquote>
  <p>Uncaught SyntaxError: Unexpected token ';'</p>
</blockquote>

<p>Poitning to the last semicolon before a function brakets close. But if i remove the semicolon, the error is starting to point to something else, like closing brakets or something else</p>
