Created
April 12, 2011 20:20
-
-
Save antpaw/916306 to your computer and use it in GitHub Desktop.
useful for String.fromCharCode();
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.toCharCode = function(){ | |
var str = this.split(''); | |
var work = []; | |
for (var i = 0; i < str.length; ++i){ | |
work.push(str[i].charCodeAt(0)); | |
} | |
return work; | |
}; | |
console.log('test'.toCharCode().join(',')); |
JavaScript-Packer
commented
Jan 14, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment