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()<
If you don't want to use any built in function. Try this
var string = 'abcdefg'; var newstring = ''; for(let i = 0; i < string.length; i++){ newstring = string[i] += newstring; } console.log(newstring);