0

Write a function that accepts a string and returns an array of its character code in reverse order

eg. function("abc") returns [99, 98, 97]

13th Aug 2017, 11:31 PM
oneCaptain
oneCaptain - avatar
2 ответов
+ 1
var arr = []; function reverseASCII(str) { for(var i = str.length-1; i > -1; --i) { arr.push(str.charCodeAt(i)); } } reverseASCII("hello"); alert(arr);
14th Aug 2017, 2:49 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
@chaoticDwag thanks a lot man!!!🙂
14th Aug 2017, 2:54 AM
oneCaptain
oneCaptain - avatar