배열
- 자바스크립트에서 배열은 반드시 동일한 타입만 들어오는 것이 아니다.
const data = [1234, "html", true, 'css'
, {userid:"jjoung", name: "쫑쫑이"}];
.join()
- 배열명.join("구분문자")
- 구분문자를 사용해서 배열을 하나의 문자열로 만들어 반환
- 구분문자를 지정하지 않을 시 자동적으로 콤마( , ) 로 설정
const 배열명 = [1, 2, 3];
let str_num = 배열명.join("/");
str_num = 배열명.join();
.split()
- "문자열".split("구분자")
- 문자열을 구분자 기준으로 잘라서 배열
const name = "HTML,CSS,JS";
name.split(",");
.slice()
- 배열명.slice(startIndex, endIndex)
- startIndex 부터 시작하여 endIndex 앞까지
"문자열".split("구분자").slice(startIndex, endIndex)
정리
- 09_javascriptStandardObject
-> 01_Array_class -> 01_forOf_forEach_push_pop_splice_reverse_sort_slice_indexOf.html, 01.css, 01.js