var str = "abcde"; var arr = str.split(""); arr = arr.reverse(); document.write(str+'<br/>'); document.write(arr.join(""));