js num to sstring code example
Example 1: javascript letters as number
const toChars = n => `${n >= 26 ? toChars(Math.floor(n / 26) - 1) : ''}${'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[n % 26]}`;
// Examples
toChars(0); // A
toChars(1); // B
toChars(25); // Z
Example 2: javascript compare number to string
let string = "1";
let number = 1;
if (parseInt(string) === number){
// STRING AND NUMBER MATCHES
}
if (string == number){
// STRING AND NUMBER MATCHES ALSO BECAUSE == instead of ===, means it won't compare datasets, only the content
}