javascript class constructor with parameters