Answers for "js get alphabet"

19

alphabet array js

const 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"];
//for upper case use the toUpperCase() function
Posted by: Guest on July-01-2020
2

js get alphabet as array

const alphabet = "abcdefghijklmnopqrstuvwxyz".split("");
Posted by: Guest on January-26-2021
1

javascript number in alphabet

// converts numbers to spreadsheet letter columns eg. 1 -> A
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); // undefined
numToSSColumn(1); // A
numToSSColumn(26); // Z
numToSSColumn(-1); // undefined
numToSSColumn(27); // AA
numToSSColumn(475254); // ZZZZ
Posted by: Guest on December-02-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language