extend like class in js