Advertisement
728x90
You can use the String.prototype.charCodeAt() method to convert string characters to ASCII numbers. For example, let's find ASCII code for the first letter of 'ABC' string,
javascript
1"ABC".charCodeAt(0); // returns 65Whereas String.fromCharCode() method converts numbers to equal ASCII characters.
javascript
1String.fromCharCode(65, 66, 67); // returns 'ABC'Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 79
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
336of476