Sure, but then you have to create a function for each property, even if it's a number or a string. Those bytes add up significantly in large applications.
Additionally, specifying the property as a string allows you to implement "unknown property" handlers, which is another extremely powerful idiom.
Additionally, specifying the property as a string allows you to implement "unknown property" handlers, which is another extremely powerful idiom.