공백 제거 함수(trim, replace) trim( ) 앞 뒤의 공백을 제거해주는 함수 ( trimStart( ) : 앞 / trimEnd( ) : 뒤) let a = " a b c d e "; a.trim(); // 'a b c d e' replace( ) 정규식을 함께 이용하여 공백 제거 let text = ' a b c d e'; let regex = / /gi; text.replace(regex, ''); // 'abcde' 개발공부/JavaScript 2022.09.15