Convert a string into a charcode list

by Mohan 2012-09-20 22:57:27



Convert a string into a charcode list
Method 1: JavaScript 1.6
Array.map('foo', function(x) { return String.charCodeAt(x) }) // is [112,111,111]
Method 2: JavaScript 1.7
[ String.charCodeAt(x) for each ( x in 'foo' ) ] // is [112,111,111]



529
like
0
dislike
0
mail
flag

You must LOGIN to add comments