Could somebody explain me what Crockford means when he speaks about string constants:
"The dot notation can be used when the subscript is a string constant in the form of a legal identifier."
http://javascript.crockford.com/survey.html
AFAIK he refers to the constants as the object properties but why called constants if their value may change at any time.
Or, does he refer at those as constants, because once the property name is defined, it never changes?
If I should make a pseudo-code base on his words, I'll do something like this (note that this code is just for clarify my idea and it is not actually javascript code, despite of the sameness):
const const1 = 'name'; object person = {name = 'Ed'}; print person.const1 //it should print "Ed" Thank u very much
const1is not a property of thepersonObject that won't print'Ed'. Also, please refrain from the use of pseudo-code.conststring, which in spite of being calledconst, is still a variable, and which would be used as inperson[const]. Remember that when Crockford wrote this JavaScript did not even have aconstvariable type.