참조형 - Array 배열
const fruits = new Array('apple' , 'Banana' , 'cherry') //생성자 함수
cocnsole.log(fruits)
const fruits2 = new Array['apple' , 'Banana' , 'cherry'] //생성자 함수
cocnsole.log(fruits)
대괄호를 사용한 리터럴 방식 배열함수
const fruits2 = new Array['apple' , 'Banana' , 'cherry'] //생성자 함수
cocnsole.log(fruits[1])
대괄호 표기법으로 인덱싱한 방법
console.log(fruits.length)
배열의 길이를 확인할 수 있다
console.log(fruits[fruits.length -1])
길이가 얼마인지 몰라도 마지막 아이템을 조회할 수 있다.
블로그의 정보
개발 블로그👩💻
Blairj