형변환하기
1. 개요
2. 구문의 선두에서 형을 강제한다.
3. 숫자에서 문자열로 형변화하기
const score = 10;
// bad
const totalScore = new String(score);
// bad
const totalScore = score + '';
// bad
const totalScore = score.toString();
// good
const totalScore = String(score);4. 문자열에서 숫자로 형변화하기
4. Conclusion
참고
Last updated