Skip to content

Commit 61be516

Browse files
committed
Update stringReverse.js
1 parent f6ae74f commit 61be516

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

stringReverse.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function reverse(str){
2+
if(!str || str.length <2) return str;
3+
return str.split('').reverse().join('');
4+
}
5+
6+
console.log(reverse(('hitesh'))) ; //hsetih

0 commit comments

Comments
 (0)