how to print alphabet in javascript code example
Example 1: how to make an alphabet in javascript
let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
Example 2: javascript number in alphabet
function numToSSColumn(num){
let s = '', t;
while (num > 0) {
t = (num - 1) % 26;
s = String.fromCharCode(65 + t) + s;
num = (num - t)/26 | 0;
}
return s || undefined;
}
numToSSColumn(0);
numToSSColumn(1);
numToSSColumn(26);
numToSSColumn(-1);
numToSSColumn(27);
numToSSColumn(475254);
Example 3: make alphabet js
[...Array(10).keys()]