Reverse a string

JavaScript string doesn't have a reverse method. But you can just use the Array.prototype.reverse method.

function reverse(str:string) {
  return str.split('').reverse().join('');
}

results matching ""

    No results matching ""