A javaScript function base class