Skip to content

JavaScript Alphabet Array | Simple example code

  • by

There are many ways to create or assign an Alphabet value in JavaScript Array.

Simplicity and naturally readable array:

char alphabet[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

Create Alphabet Array JavaScript

HTML example code: Generating the alphabet in JavaScript

1. Split method


  var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');


2. short ES6 version

const alphabet = [...'abcdefghijklmnopqrstuvwxyz'];

3. Map function


  const alpha = Array.from(Array(26)).map((e, i) => i + 65);
  const alphabet = => String.fromCharCode(x));


Output: It will same for all methods are used.

Create JavaScript Alphabet Array

Do comment if you have any doubts and suggestions on this JS Array topic.

Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.