How to revert a string in JavaScript

var reverseString = function(s) {
    let l = 0;
    let r = s.length-1;
   
    while (l < r) {
        [s[l], s[r]] = [s[r], s[l]];
        l++;
        r--;
    }
};

Comments

Popular posts from this blog

Check MySQL query history from command line

Installing chocolatey on Windows

Fixed: ImportError: No module named utilities.common.tools