Magic history of 'const' & 'let'

Please give here a brief description of the process of the appearance of the keywords “const” and “let” in the specification or provide a link to an existing essay (story). I looked through the specifications, and the keyword “const” was reserved from the very beginning (in 1997). "Let" first appeared in the specification as a reserved word in June 2011, in version 5.1. And already in the June 2015 spec, in the “ Keywords” section, “const” is present, and “let” is included in “note”. I'm really interested, and it would be great to hear from people who were directly involved in this thought process. Thank you!

Fun fact: Firefox had 'let statements' in 2006

1 Like

That is, for five whole years it was possible to write for Firefox the 'let'? :thinking:

I remember when we were messing around with Tamarin around that time a bunch of us at the office got "let is the new var" t-shirts. I don't think many of us understood why we got the t-shirts, but free swag is free swag.

1 Like

Indeed; at that time Mozilla was extending JavaScript with various features, many of them were standardised later. AFAIR, that included block-scoped variables (let), generators, comprehensions (not standardised), the /y flag in regexps, the infamous __proto__ magic property. However, those features were rarely used on the web, because, at that time, people that didn’t write IE-only code tended to write code that run on any browser. (Well, except the worst designed one, namely the __proto__ magic property, that ended to be copied by all browsers...)

1 Like

Yes, maybe someday they will write a book about the history of the development of language in general (in a popular science format), or they will make a movie about the “poor” (my favorite) language... )) That would be great!

They did!

1 Like

Pre requirements: A sense of humor and tolerance for non-native english
speakers. Are you on a movie show? Yes, ma'am. Well, here are your places.
The film has already started. How? We just bought tickets! This film is
not blessed, it began 28 years ago ... Sit quietly, you will understand
everything soon ... The film company "Magic Picture" represents ... in
roles John Doe and others ... in the film "Garbage Collector". There was
2015. John, an ordinary builder-builder prayed to God for the onset of a
crisis in the construction sector. Thus, he could switch to computer
sciences, which he was fascinated from childhood, but, by the will of
fate, he went on a different life path ... Unfortunately, his construction
business did not fade away and he began to independently study the binary
calculation system, so that he was hot then take communion. After 8 years
of low -contrasting reading of the ECMA-262 specification and surrounded
by inviting advertising slogans such as “Learn our programming language!
This is easy and fun!”, John finally realized the inexorable acceptance of
the bitter truth - either he is so stupid, or all the rest are so stupid.
None of the options suited him. And, as it usually happens, during a
period of a large tension of thoughts, energy should be discharged ... One
evening, John wandered into the next computer forum in search of
enlightenment. But, this time, a surprise was waiting for him, the angel
himself took pity and gave a hyperlink on one interesting book
“JavaScript: The First 20 Years”. John pressed the link and ... And our
hero moved in time 28 years ago, in 1995, to the company "Netscape
Communications Corporation". He was an employee of this company, his
duties included a comprehensive cleaning of office premises and the
position was called a "garbage collector". This is followed by various
episodes, as an ordinary cleaner at night, in a dim light, he took the
crumpled, torn drafts and collected his puzzle in pieces. Constants and
expressions, lexical and variable environments, classes and objects... The
second part of the film will tell about the secret laboratory, in which,
the time hyperlinks were convened.

Do not paste LLM-vomit into this forum.