Reverse string functions
function reverseString(str) {
return str.split("").reverse().join("");
}
// without methods
function reverseString(str) {
var newstr= "";
for (var i = str.length - 1; i >= 0; i--) {
newstr = newstr + str[i];
}
return newstr;
}