[JavaScript] ES2022 새로운 특징
JavaScript ES2022 Array.prototype.at() 음수로도 배열의 요소를 가져올 수 있습니다. const arr = [1, 2, 3, 4, 5] console.log(arr.at(-1)) // 5 // console.log(arr[arr.length - 1]) // 5 console.log(arr.at(1)) // 1 console.log(arr[1]) // 1 Object.hasOwn() Object.hasOwn()은 Object.prototype.hasOwnProperty()의 대안으로 나오게 되었습니다. 객체안에 상속받지 않은 프라퍼티가 존재하면 true, 아니면 false를 반환합니다. Object.create(null)로 객체를 생성하여 프로토타입이 없는 객체여도 Object..