[프로그래머스] 대문자와 소문자 (javascript)

몽슈뜨·2023년 1월 8일
0

programmers

목록 보기
47/62
post-thumbnail


🎯나의 풀이

function solution(my_string) {

  const answer = [...my_string].map(asc => asc.charCodeAt() >= 
                                    65 && asc.charCodeAt() <= 95
  ? asc.toLowerCase() : asc.toUpperCase()).join("") ;

  return answer
}
profile
개발자되면 맥북사줄께

0개의 댓글