typeof로 데이터 타입을 확인하면 object
로 나온다. -> 이 방법으로는 확인 불가
let array = []
let object = {}
console.log(typeof array) //'object'
console.log(typeof object) //'object'
배열인지 확인하려면 Array.isArray(변수명)
을 쓰면 된다!
Array.isArray(array) //true
Array.isArray(object) //false