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

[Codewars] Remove String Spaces (8 kyu) / JavaScript

by fluss 2022. 10. 29.

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

 

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:

Simple, remove the spaces from the string, then return the resultant string.

 

설명:

간단하게 문자열에서 공백을 제거하고 결과 문자열을 반환하세요.

 

풀이

 공백을 기준으로 나누고 합쳐주었다.

 

코드

function noSpace(x){
  return x.split(' ').join('');
}

댓글