CodeToFun
Learn Programming Free
Tutorials
Languages
Features
About
Sign In
Tutorials
Languages
Features
About
Sign In
Back
/
JavaScript Number Pattern 15
JavaScript Number Pattern 15 (Try It — Browser)
Try It
Run
Reset
Save
Save to Google Drive
Sync with your Google account
Download HTML
Save to your device
Share
Full
HTML Code
Copy
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Number Pattern 15 - Try It (Browser)</title> </head> <body> <h1>Alternating 0-1 Triangle (document.write)</h1> <p>Edit loop limits, then click Run.</p> <script> const rows = 5; for (let i = 1; i <= rows; i++) { for (let j = i; j >= 1; j--) { document.write(j % 2); } document.write("<br>"); } </script> </body> </html>
Lines:
0
| Characters:
0
Live Preview
Auto-refresh on Run