Exercise: Using iteration and the canvas
Use a while loop to complete the code so that the picture generated matches this one. At each iteration, change the value of the radius by 10.
Note:
Hints:
Make sure to change the value of counter in the loop body.
Solution to the exercise
Here is a possible solution.
Note:
Hints:
- undefined
1
2
window.onload = startFunction;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX