/ Published in: JavaScript
Requires JavaScript 1.6 or higher
Syntax:
Array string.toCharCodes() returns an array containing every one of string's character codes, in order.
String String.fromCharCodes(charCodes) returns a string created from every character code in the array, charCodes.
Expand |
Embed | Plain Text
String.prototype.toCharCodes = function toCharCodes() { return Array.prototype.map.call(this, function(str) { return str.charCodeAt(0) }) }; String.fromCharCodes = function fromCharCodes(charCodes) { return String.fromCharCode.apply(this, charCodes) };
You need to login to post a comment.
