class Base { method() { print "Base.method()"; } } class Derived < Base { method() { super.method(); } } class OtherBase { method() { print "OtherBase.method()"; } } var derived = Derived(); derived.method(); // out: Base.method() Base = OtherBase; derived.method(); // out: Base.method()