문자열의 앞부분과 뒷부분의 빈 문자열을 모두 제거해 준다.
let test = " hello ";
test = test.trim();
console.log(tst);
//hello 라는 결과가 출력된다.
문자열의 앞 부분 빈 문자열을 제거해 준다.
let test = " hello ";
test = test.trimStart();
console.log(tst);
//"hello " 라는 결과가 출력된다.
문자열의 뒷 부분 빈 문자열을 제거해 준다.
let test = " hello ";
test = test.trimStart();
console.log(tst);
//" hello" 라는 결과가 출력된다.