Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Looks like a duplicate.
JSClass is as old as 2007, and just because it exists doesn't mean it's a good idea at all.
It tries to copy Ruby syntax, but ends up in a incomprehensible, poorly designed mess. Putting obvious early JS overriding nonsense aside (1 parameter call and 2 parameters call has very different meanings to the arguments on each position), Ruby doesn't use
new Class
at all, onlyClass.new
is used to instiantiate a class; JSClass uses.initialize
andnew
interchangably in schizophrenic ways. Like, why do wenew
the result as a function instead of.initialize
which is clearly the constructor? Why is this function then fed in like an object? Two different things are being fed into the function and it can easily break in some edge cases.this.super
is also superfluous: the only correct way of doing inheritance in JS is to use the prototypical chain (.prototype
and.constructor
), the language feature that has always existed.this.super
is an ugly hack that is completely unneccessary, prone to breaking (what if I have a method namedsuper
too?), not to mention just plain wrong.My point is, the whole idea this kata is based on is horrendous, and turning a horrible idea into a kata is one of the worst things ever. There are lots of people in the JS ecosystem who develop ways to use JS incorrectly and attempt to make JS behave like other languages because they have a terrible understanding of programming languages, and they should not be perpetuated.