We have an array of Rectangles called rectangleArray and a function updateRectangle(rect) that takes a single rectangle as a par
ameter and changes its color to a random color. How can we easily change the color of every rectangle inside rectangleArray?
1 answer:
Answer:
Following are the code
for(var k = 0; k< rectangleArray.length; k++) // iterting the loop
{
updateRectangle(rectangleArray[k]); // update the rectangle color
}
Explanation:
- In the given answer we have iterate over the loop will iterated until the length of rectangle array size-1
- In every value of k, we have called the update rectangle function which changes the color of the rectangle of a rectangle class
You might be interested in
Answer:
options is right
Explanation:
<span>Satellite images are based on data obtained by landsat satellites. </span>
Answer:
'retrieval'
Explanation:
Mixed and market economies protect individuals' ability to make their own economic decisions.
It stores data and retrieving digital information using one or more rigid rapidly rotating disks (platters) coated in magnetic material