[JavaScript] 문자열 길이 구하기
자바스크립트로 문자열 길이를 구할 수 있다. ex.1 const str = "EEE"; console.log(`${str.length}`); 결과값 : 3 ex.2 const word1 = 'green' const word2 = 'red' const word3 = 'black' const length1 = word1.length; const length2 = word2.length; const length3 = word3.length; console.log(length1 + length2 + length3) 결과값 : 13
언어/JavaScript
2023. 7. 4. 12:36
- Total
- Today
- Yesterday