String.fromCodePoint and it seems (to me) to pick up everything that
String.fromCodePoint supported widespread by browsers and devices and if so, does it make
String.fromCharCode obsolete, or is there a reason you would use
String.fromCharCode instead sometimes?
fromCharCode is not obsolete yet, but it would be if it would be supported by all Browsers. However
fromCharCode is about twice as fast as
String.fromCodePoint() Not supported by Internet Explorer and Safari
String.fromCharCode() Supported since for ever, double as fast
String.fromCodePoint is not widely supported, in fact it's not supported at all in Internet Explorer and Safari, and only in Chrome 41 and up, and Firefox 29 and up.
This doesn't mean it's obsolete, it means it's a new method, only first defined in ES2015.
It also means that browser support will get better in time, as browsers implement all the new features in the 6th edition of ECMAScript.
For now, it's not very suitable for production use if you need to support all current browsers, but there is a polyfill available on MDN if you really need to have this method available in all browsers.
©2020 All rights reserved.