How do you reverse a string in JavaScript?
string reverse print javascript |
Hi,
Today we discuss how to given string reverse print using javascript. blow code.
function stringprint(str){
let strpint = "";
for(let i=0;i<str.length;i++){
strpints = str[i]+ strpint;
console.log(strpints);
}
return strpints;
}
Reverse print ;
function reverseespringprint(str){
let reverstr = "";
for(let i>str.length-1;i>=0;i--){
revstr = reverstr+str[i] ;
console.log(revstr);
}
return revstr;
}