daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function reverse(str) {
  2.     for(let i = 0, j = str.length-1; i < j; i++, j--)
  3.         [str[i], str[j]] = [str[j], str[i]];
  4. }
  5.  
  6. const str = 'abcde';
  7. reverse(str);
  8. console.log(str);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top