I have the following:
function showUnicode()
{
var text = prompt( \'Enter the wanted text\', \'Unicode\' ),
unicode = 0,
ntext,
temp,
JavaScript uses UCS-2 internally.
This means that supplementary Unicode symbols are exposed as two separate code units (the surrogate halves). For example, '
NaN = Not a Number
You need to initialize "unicode" as a numeric type:
var unicode = 0
You should initialize the unicode
variable to something, or you're adding the char codes to undefined
.