데이터타입
(DataType 자료형) / 숫자(number), 문자(string)
1. 종류
(console 예시)
Last updated
(DataType 자료형) / 숫자(number), 문자(string)
Last updated
//글자의 개수
string.length = str.length
> 'Hello world'.length
< 11
//소문자 -> 대문자로 출력됨
> 'Hello world'.toUpperCase()
< "HELLO WORLD"
//문자의 인덱스 (0~시작)
> 'Hello world'.indexOf('0')
< -1 //대문자 'O' 없음
> 'Hello world'.indexOf('o')
< 4 //소문자 'o'가 나오는 순서
> 'Hello world'.indexOf('world')
< 6 //단어의 순서
//공백 생략하는 기능
> ' hello '.trim()
< "hello"