Category : var

When I use var in the loop I get no error. function reverseString(str) { for (var reversedStr = “”, i = str.length – 1; i >= 0; i–) { reversedStr += str[i]; } return reversedStr; } console.log(reverseString(“hello”)) //OUTPUT ——–> olleh when I use let in the loop I get an error. function reverseString(str) { for ..

Read more