javascript base class