Search code examples
mootools

Using 'Class' and ES6


Is there a conflict of behavior for using the Class expression, since it became a reserved word in the latest version of Ecmascript? Can't say if there is identity of grammar between the two contexts, but I guess the built-in noun takes precedence.


Solution

  • JavaScript is case-sensitive. Its class keyword and MooTools' Class identifier don't conflict at all.

    If you mean the "classes" generated, I wouldn't try to use one style to subclass a "class" created with the other style (though you might get it to work, particularly if using class to subclass a Class class), but other than that, there's no big conflict. They both create objects with associated prototypes.