backslash 두개 시 출력은 backslash 하나만 출력된다.
\
tfeed -> t는tab
으로 출력 시 스페이싱이 생긴다.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 h e l l o \n
w o r l d \n
! ! ! console.log(str.charCodeAt(1)); --> 101
'ASCII Code(아스키 코드)'는 숫자에 따라 문자 매핑을 확인할 수 있다.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 h e l l o , w o r l d ! ! ! console.log(text.indexOf("1",3)); --> 세번째서부터 출력해라! 3이 출력된다.
console.log(text.indexOf("1",4)); --> 네번째부터 I를 출력해라! 10이 출력된다.
console.log(text.lastIndexOf("1")); --> 마지막에서부터 I를 출력해라! 10이 출력된다.
console.log(text.starsWith("ello"); --> false 왜냐? 첫번째부터 찾기 때문에 hello해야 참이다.
console.log(text.starsWith("ello",1)); --> ture 왜냐? e가 1로 시작하기 떄문이다.
- String.includes: 전체에서 ""가 있는지 확인
- String.starsWith: 실제로 "" 시작하는지 확인
- String.endsWith: 실제로 "" 뒤에서 시작하는지 확인
(stars,ends는 좀더 세밀한 조건 판단할때 쓰는 메소드이다.)