class MyArr extends Array { push(...args) { console.log(args) super.push(...args) } } let arr = new MyArr(); arr.push(5); arr.push(50); console.log(arr)