배열 크기 및 배열 여부 확인: Array.length, Array.isArray()
배열 추가/삭제: Array.push(), Array.pop(), Array.shift(), Array.unshift(), Array.splice(), Array.slice()
배열 탐색: Array.indexOf(), Array.lastIndexOf(), Array.includes()
배열 변형(callback 미사용): Array.sort(), Array.reverse(), Array.join
let arr_1 = new Array(10);
let arr_2 = [];
console.log(arr_1); // output : [ 10 empty items ]
console.log(arr_2); // output : []
let fruits= ["apple", "orange", "melon"];
console.log(fruits); // output : "apple","melon"
console.log(fruits.length); // output : 3
fruits[1] = "kiwi";
console.log(frutis); // output: apple kiwi melon
let nums = [];
nums[0] = "one";
nums[1] = "two";
console.log(nums.length); // 2
nums["once"] = "once"; // 문자열로도 추가할 수 있음
nums["twice"] = "twice";
console.log(nums); // output: one, two, once: once, twice: twice
let num = 123.456;
let str = "Here I am!";
let fruits = ["apple", "orange", "melon"];
console.log(Array.isArray(num)); // output: false
console.log(Array.isArray(str)); // output: false
console.log(Array.isArray(fruits)); // output: true
let fruits = ["apple", "orange", "melon"];
console.log(fruits); // output: [ 'apple', 'orange', 'melon']
console.log(fruits.length); // output: 3
delete fruits[1];
console.log(fruits); // output: [ 'apple', <1 empty item>, 'melon' ]
console.log(fruits.length); // output 3