How do you reverse a string in place (or in-place) in JavaScript when it is passed to a function with a return statement, without using built-in functions (.reverse()<
.reverse()<
In ECMAScript 6, you can reverse a string even faster without using .split('') split method, with the spread operator like so:
.split('')
var str = [...'racecar'].reverse().join('');