fromCharCode一样使用String

fromCharCode一样使用String

本文介绍了你可以像String.fromCharCode一样使用String.fromCodePoint吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我还在学习JavaScript并练习从键盘输入。我刚刚了解了 String.fromCodePoint ,似乎(对我来说)拿起 String.fromCharCode 所做的一切。

I'm still learning JavaScript and practicing with getting input from a keyboard. I just learned about String.fromCodePoint and it seems (to me) to pick up everything that String.fromCharCode does.

String.fromCodePoint 是否受到浏览器和设备的广泛支持?若然,它是否为 String.fromCharCode 已过时,或者您有时会使用 String.fromCharCode 吗?

Is 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 尚未过时,但如果所有浏览器都支持它。但的是关于
Internet Explorer和Safari不支持

  • String.fromCodePoint()Not supported by Internet Explorer and Safari


永远支持,加倍加速

String.fromCharCode()Supported since for ever, double as fast

区别:


这篇关于你可以像String.fromCharCode一样使用String.fromCodePoint吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 21:07