How do you find reverse an string without using any inbuilt methods in javascript?
Reversing a string is one of the most frequently asked question in Front End Developer interview.
const reverseStr = (str) => {
var newStr = "";
for (var i = str.length - 1; i >= 0; i--) {
newStr += str[i];
}
return newStr;
}
reverseStr('playerofcode');