News for hackers. Stuff that matters.
Re:JavaScript Structs by Swalden123 on Friday October 11, 2024 @09:25AM (#41809296)
Classes are still built around prototype inheritance, there are some differences, however they are still an easier to use api on top.
Re:JavaScript Structs by LegionMammal978 on Friday October 11, 2024 @11:05AM (#41810129)
Yeah, iirc private properties (added in ES2022) are currently the only part of ES6 classes that can neither be created nor accessed using prototype-based code, to the consternation of some people when they were added. Of course, provate properties can still be readily emulated with a WeakMap in a function scope.