++ is used to increment a value by 1
( x = x + 1 ). When concatenating Strings, you just need one plus sign:
var total = "The total is " + x ;.
In this case we are combining random rgb values, using individual variables.
To establish the random values, we first assign the variables to a range of numbers.
var r = randomNumbers(0,255);
var g = randomNumbers(0,255);
var b = randomNumbers(0,255);
We then apply them to the rgb statement using concatenation and a short cut:
var color = rgb"( "+r+", "+g+", "+b+")";
This is the full version of the code:
var color = "rgb("+randomNumber(0,230)+","+randomNumber(0,230)+","+randomNumber(0,230)+")";
Since we declared and initialized variables for each rgb value, we use the simpler short cut. It reads as stated above:
rgb( concatenated with the value of
r concatenated with , concatenated with the value of
g concatenated with , concatenated with the value of
b concatenated with