3 ms·
On the one hand, you’d think the copy would just have a prototype that points to the same as the original’s prototype, and that would make this all work out. I
by jwalton 3y ago
On the one hand, you’d think the copy would just have a prototype that points to the same as the original’s prototype, and that would make this all work out. I’m surprised that’s not what happens since in 99% of cases it would be fine.
On the other hand, when you consider #privateMembers, you realize cloning a class in JS is basically impossible (and adding them to the language was probably a horrible mistake).