79078599

Date: 2024-10-11 14:21:10
Score: 2
Natty:
Report link

Here is the Best way in my opinion.

const reverseString = function (str) {
    let newStr = ''
    for(let i = str.length - 1 ; i >= 0 ; i--){
        console.log(str[i])
        newStr +=  str[i]
    }
};

Because You are making another array by first splitting then reversing and then joining again. You are taking extra steps.

To all developers, I would be happy to get comments on my code

The Real Challenge is to do it in-place Anyone Accepts?

Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: Idrees Ahmed