- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
var stack = [], getter
var lel = f => {
stack.push(f);
return (...params) =>
stack.forEach(f => f.apply(this, params))
};
Object.defineProperty(document.body, 'onclick', {
set: f => getter = lel(f),
get: args => getter
});
document.body.onclick = () => console.log(1)
document.body.onclick = () => console.log(2)