문자열이란?
var str = 'coco mong'
console.log(str[0]) // 'c'
console.log(str[4]) // 'o'
console.log(str[5] // ' '
'Blue White'.indexOf('Blue') // 0
'Blue White'.indexOf('blue') // -1
'Blue White'.indexOf('White') // 5
'Blue White White'.indexOf('White') // 5
'Blue White'.lastIndexOf('e') // 9
'Blue White'.includes('blue') //false
'Blue White'.includes('Blue') //true
var str = 'Hello from the other side';
console.log(str.split(' '));
// ['Hello', 'from', 'the', 'other', 'side']
str.split('\n') //한 줄 띄기에 스플릿
str.split(',') //쉼표에 스플릿
var str = 'abcdefghij';
console.log(str.substring(0, 3)); // 'abc'
console.log(str.substring(3, 0)); // 'abc'
console.log(str.substring(1, 4)); // 'bcd'
console.log(str.substring(-1, 4)); // 'abcd', '음수는 0으로 취급'
console.log(str.substring(0, 20)); //'abcdefghij, index 범위를
벗어나는 값은 나오지 않는다. 만약 자바라면 오류가 나온다
console.log('ABCDE'.toLowerCase()); //'abcde'
console.log('abcde'.toUpperCase()); //'ABCDE'
let word = 'hello';
word.toUpperCase() //'HELLO'
----------------------------
그럼 word는 바뀌었을까?
word =>'hello'가 나온다