Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by Zarel on Wednesday February 10, 2021 @05:07AM
(#26087387)
A lot of people have responded "yes", but no one's taught you how yet, so here's some example code that you can paste into your browser's Devtools or Node's REPL:
class Dog {
speak() {
console.log("bark!");
}
}
class Cat {
speak() {
console.log("meow!");
}
}
animal = new Dog();
animal.speak();
Object.setPrototypeOf(animal, Cat.prototype);
animal.speak();
This will produce: bark!
meow!
Does JavaScript let you do this monstrosity of terrible code?