Showed @stjepang the 6 or so ways to do inheritance in JavaScript w/o traits, and his look of disbelief was priceless.
For reference: prototypes, class extends, util inherits (multi inheritance), object initializers ({read} in streams), Symbols (e.g. iterators), methods (then).
-
Show this thread
-
Another notable mention goes to well-known prototype names such as toString and toJSON that dictate how a value is stringified/serialized respectively. Also the details of how prototype chains can be configured through Object.assign are something special.
1 reply 0 retweets 1 likeShow this thread
Rust's traits are pretty great in comparison. Bit more boilerplate usually, but that seems solvable.
5:29 PM - 4 Feb 2020
from Berlin, Germany
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.