a simple class constructor in js