function reverseString(str) { a= str.split(""); b = a.reverse(); c = b.join(""); return c;}
reverseString("hello"); // olleh
freecodecamp 基础算法题笔记
原文:http://www.cnblogs.com/sharyn/p/6845844.html