JavaScript Doesn't Support Operator Overloading... Right? - Iwo Plaza
WhatTheStack Conference
0:00 / 0:00
JavaScript Doesn't Support Operator Overloading... Right? - Iwo Plaza
13 просмотров · 9 дн. назад
WhatTheStack Conference
108 подписчиков
13 просмотров · 9 дн. назад
JavaScript doesn't support operator overloading, but that hasn't stopped libraries from bending the language until it does. This talk is a tour through the dark corners of JS: the runtime parsing tricks, valueOf hacks, and bundler transforms that make it possible, along with the surprising edge cases that make each approach painful.
The elephant in the room is TypeScript. Every existing solution forces a trade-off: give up type inference, or give up ergonomics. I refused to accept that, so I built something that doesn't ask you to.