CodeToFun
Learn Programming Free
Tutorials
Languages
Features
About
Sign In
Tutorials
Languages
Features
About
Sign In
Back
/
JavaScript Alphabet Pattern 14
JavaScript Alphabet Pattern 14 (Try It)
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 Alphabet Pattern 14 - Try It</title> </head> <body> <h1>Step-by-two alphabet rows</h1> <p>Open the HTML code, tweak <code>start</code>, <code>outerEnd</code>, or <code>step</code>, then click Run.</p> <pre id="output"></pre> <script> (() => { const start = "A".charCodeAt(0); const outerEnd = "I".charCodeAt(0); const step = 2; let result = ""; for (let i = start; i <= outerEnd; i += step) { let line = ""; for (let j = start; j <= i; j++) { line += String.fromCharCode(j); } result += line + "\n"; } document.getElementById("output").textContent = result; })(); </script> </body> </html>
Lines:
0
| Characters:
0
Live Preview
Auto-refresh on Run