Description
Under Objects it says you shouldn't use reserved words. I'm not sure this is important, though avoiding them might make sense for readability. At least using klass
instead of class
would seem wrong to me, as you are corrupting a word instead of finding a readable synonym (like type
).
Right now you can use just about anything. E.g., test = {function: 1}; test.function === 1
–but additionally I think we can be confident this will continue to be the case. IndexedDB uses the method cursor.continue()
which isn't just a future-protected reserved word (like class
) but a reserved word right now. But IndexedDB represents current API design by people involved in the standardization process.
I think it's questionable from a readability point of view to use current keywords, but I don't see any reason at all to avoid words reserved for possible future use (class
and private
, as used in the example, are both examples of that).