My code fails the tests, what am I doing wrong? at the same time help improve the code itself?
function digitize(n) { var str = String(n); var str1 = str.split('').reverse(); return str1; } digitize(35231); You need to get: '[1, 3, 2, 5, 3]', instead I get: '[\' 1 \ ', \' 3 \ ', \' 2 \ ', \' 5 \ ', \' 3 \ ']
r str1 = str.split('').reverse();why not, do not tell me? - anonim1,2,3,3,5- Grundy