[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/parshva45/Leetcode-JavaScript/master/Reverse%20String.js [Back]  [Original]

/*Write a function that takes a string as input and returns the string reversed.

Example:
Given s = "hello", return "olleh".*/

/**
 * @param {string} s
 * @return {string}
 */
var reverseString = function(s) {
    return s.split('').reverse().join('')
};

Web Proxy Viewer  |  New URL  |  Original Page