S2
jS
Learn
Create Your Own
Split Screen
Go to Live Site
Next Page
There's even a shortcut for
thing= thing + 1;
You can simply say:
thing++;
With that, a
for loop
becomes even more concise:
for {var corner= 0; corner < 100;
corner++
) {
<HTML> <head> <title> My new Web Page </title> </head> <body> <canvas id=myCanvas width=300 height=300 style="background-color: pink;"> </canvas> <script> var ctx = myCanvas.getContext("2d"); for (var corner= 0; corner < 100; corner++) { ctx.strokeRect(corner, corner, 50, 50); } </script> </body> </html>