Hi everybody
At the moment I am working on a basic introduction course to JavaScript and in this process I am checking up all the basic stuff I learned years ago and have been using for years. I must admit I do find some stuff I've forgotten, miss understood, or stuff I was not aware of. All in all; a good process for me also. We all know of PromoteJS and w3fools and what those stand for and one resource we referee to as a solid resource for JavaScript documentation are the Mozilla Developer Network (MDN). So; I am using MDN as source and references for my work. Tough; I got a bit puzzled by the "const" keyword in the MDN documentation: https://developer.mozilla.org/index.php?title=en/JavaScript/Guide/Values%2C_Variables%2C_and_Literals#Constants This keyword is one of those moments where I more or less have gone "what a ****!! Where did I miss that part of the language?". In the documentation on the URL above it does look like a legal keyword all over. If one dig deeper into the reference of the "const" keyword in the documentation above one get a more in depth explanation of it: https://developer.mozilla.org/en/JavaScript/Reference/Statements/const At this stage it does state: "const is a Mozilla-specific extension". It does work in Mozilla and Chrome and partially in Opera. Opera recognizes the keyword but does not treat it as a constant. IE fails to recognize it and stops executing the script. I've not read all of the ECMAScript specification document due to its nature so I am a bit puzzled; are "const" part of the ECMAScript standard or is it a Mozilla-specific extension as stated in the MDN doc? If the later, a Mozilla-specific extension, I must say I find it a bit worrying that such a keyword is so vaguely marked as a Mozilla-specific extension in the MDN documentation. I do kinda start to get the feeling that the MDN documentation have little separation between what is implemented in Mozilla engine and what is core JavaScript. Over at the node.js mailing list I've also seen people mixing up WebGL specific stuff with core JavaScript stuff due to documents they read at MDN. Anybody else got this feeling? Kind regards Trygve Lie ------------------------------------------------ @trygve_lie | http://www.trygve-lie.com -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
