Converting text to Unicode in javascript

前端 未结 3 911
自闭症患者
自闭症患者 2020-12-17 06:51

I have the following:

function showUnicode()
{
  var text = prompt( \'Enter the wanted text\', \'Unicode\' ),
      unicode = 0,
      ntext,
      temp,
            


        
3条回答
  •  隐瞒了意图╮
    2020-12-17 07:44

    You should initialize the unicode variable to something, or you're adding the char codes to undefined.

提交回复
热议问题