Create a string from character code in JavaScript

Description

The following code shows how to create a string from character code.

Example


<!--   w  w  w  .  j av  a2 s .c  o  m-->
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
document.writeln(String.fromCharCode(104, 101, 108, 108, 111));
</script>
</head>
<body>
</body>
</html>

Click to view the demo

The code above generates the following result.

Create a string from character code in JavaScript