1.
var reverse = function( str ){var newStr = '', i = str.length;for(; i >= 0; i--) {newStr += str.charAt(i);}return newStr;};reverse('abcde')
2.
var reverse = function( str ){return str.split('').reverse().join('');};
3.(类似法2)
var reverse = function( str ){var stack = [];//生成一个栈for(var len = str.length,i=len;i>=0;i-- ){stack.push(str[i]);}return stack.join('');};