Javascript string-reverse-prototype from codewars answered