javascript in-class assignment