Skip to main content

Command Palette

Search for a command to run...

String Reversal(m

Published
A

Hi there πŸ‘‹, I am Anil Verma I am a passionate Full Stack Web Developer who is fascinated by complex engineering problems.

Sol#1

function reverse(str) {
return str.split(β€˜β€™).reverse().join(β€˜β€™);
}

Sol#2

rev =’’
for(let char of str){
rev = char + rev
}

Sol#3

str.split(β€˜β€™).reduce((a, b)=> b+ a,’’)