Converting a Number to a Unicode Sign

I have to print letters from A to Z each for myself. So I tried the following:

for(var i = 65; i < 91; i++) {
     $('#alphabet').append('<div class="letter">' + '%' + i + '</div>');
}

My idea is to use decimal numbers of letters (for example: 65 - A) to easily print them through a loop. Is this possible, or do I need to use an array?

Sincerely.

+6
source share
2 answers

You can use String.fromCharCode to convert character code to string.

+10
source

( ) String.fromCharCode; . Unicode (, , ), String.fromCodePoint.

, ES6/ES2015, .

+1

All Articles