Because that will a) make it clear to the programmer what kinds of attributes this class will have b) improve performance because JavaScript will not have to change the internal class at runtime.