본문 바로가기
알고리즘/Codewars

[Codewars] MakeUpperCase (8 kyu) / JavaScript

by fluss 2022. 10. 26.

https://www.codewars.com/kata/57a0556c7cb1f31ab3000ad7

 

Codewars - Achieve mastery through coding practice and developer mentorship

A coding practice website for all programming levels – Join a community of over 3 million developers and improve your coding skills in over 55 programming languages!

www.codewars.com

 

DESCRIPTION:

Write a function which converts the input string to uppercase.

 

설명:

 
입력받은 문자열을 대문자로 바꾸는 함수를 작성하세요.
 

풀이

toUpperCase()를 이용해 대문자로 바꾸어 주었다.

 

코드

function makeUpperCase(str) {
  return str.toUpperCase();
}

 

참고

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase

 

String.prototype.toUpperCase() - JavaScript | MDN

toUpperCase() 메서드는 문자열을 대문자로 변환해 반환합니다.

developer.mozilla.org

 

댓글