update javascript class snippet