Reversed Strings

Lee·2022년 6월 4일

Algorithm

목록 보기
5/92
post-thumbnail

❓ Reversed Strings

Q. Complete the solution so that it reverses the string passed into it.

'world'  =>  'dlrow'
'word'   =>  'drow'

✔ Solution

function solution(str){
  return str.split("").reverse().join("");
}
let str = 'world';
//'dlrow'

Check

reverse( )
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse

profile
Lee

0개의 댓글