CodeToFun
Learn Programming Free
Tutorials
Languages
Features
About
Sign In
Tutorials
Languages
Features
About
Sign In
Back
/
JavaScript Alphabet Pattern 15
JavaScript Alphabet Pattern 15 (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 15 - Try It</title> </head> <body> <h1>Mirror bowtie (console)</h1> <p>Edit <code>A</code>, <code>top</code>, or loops, then click Run.</p> <pre id="output"></pre> <script> (() => { const A = "A".charCodeAt(0); const top = "E".charCodeAt(0); let result = ""; for (let i = top; i >= A; i--) { let line = ""; for (let j = A; j <= i; j++) line += String.fromCharCode(j); for (let k = i; k < top; k++) line += "**"; for (let m = i; m >= A; m--) line += String.fromCharCode(m); result += line + "\n"; } document.getElementById("output").textContent = result; })(); </script> </body> </html>
Lines:
0
| Characters:
0
Live Preview
Auto-refresh on Run