function reverse(str) { return str.split("").reverse().join(""); } //a = "hello" //reverse(a) "olleh"