💡 공백도 길이에 포함
console.log('안녕하세요'.length); // 5
console.log('안녕 나비야'.length); // 6
//[참고] '안녕 나비야'[2] 2번째 인덱스는 공백
console.log('2' * 2); // 4
console.log('2' + 2); // 22
let stringNum = '2' + 2;
console.log(typeof(stringNum)); //string
※편의상 console.log 생략
'HELLO WORLD'.toLowerCase() // 'hello world'
'hello world'.toUpperCase() // 'HELLO WORLD'
'hello '.concat('world') // 'hello world'
'hello world'.indexOf('o') // 4
'hello world'.lastIndexOf('o') // 7
'hello world'.slice(0, 5) // 'hello'
'hello world'.slice(3) // 'lo world'
' hello world '.trim() // 'hello world'
※편의상 console.log 생략
'🍎🍓🍉🍇'.indexOf('🍎'); // 0
'🍎🍓🍉🍇'.indexOf('🖥'); // -1
'최초의 JavaScript는 Netscape의 Brendan Eich에 의해 만들었다.'.indexOf('Eich'); // 34
'최초의 JavaScript는 Netscape의 Brendan Eich에 의해 만들었다.'.indexOf('Dahl'); // -1
※편의상 console.log 생략
'🍎🍓🍉🍇'.includes('🍎'); // true
'🍎🍓🍉🍇'.includes('🖥'); // false
'최초의 JavaScript는 Netscape의 Brendan Eich에 의해 만들었다.'.includes('Eich'); // true
'최초의 JavaScript는 Netscape의 Brendan Eich에 의해 만들었다.'.includes('Dahl'); // false