way to inherit js from class