import { addBanner, addArticle, addHeader, addParagraph, addSubHeader } from '/scripts/article.js';
import { addInset, addInsetList, addInsetCodeListing, addInsetBulletList } from '/scripts/inset.js';
import { addImageWithCaption, addButtonGroup, addSmallButtonGroup } from '/scripts/visuals.js';
import { menu } from "/scripts/web_dev_buttons.js";
const main = document.querySelector("main");
main.append(addBanner("Learning ECMAScript 6+", "Eve Porcello", "Introduction"))
main.append(addArticle())
const article = document.querySelector("article")
article.append(addHeader("What is ECMAScript?"))
article.append(addParagraph("In 1995, JavaScript was created by Brendon Eich at Netscape so it was avialable for the Netscape browser. However, there was no standardised version at the time, so other browsers created their own adaptations. For Microsoft, they createrd their own version called JScript. Since this is bad for web developers, ECMA (the European Computer Manufacturers Association) came up with a standard called ECMAScript 1 in 1997."))
article.append(addParagraph("Versions 2 and 3 of ECMAScript were released in 1998 and 1999 respectively. Version 4 was considered to be controversial and so it was never released and eventually ECMAScript5 was relased in 2009, followed by ECMAScript6 in 2015."))
article.append(addParagraph("Since 2015, this method of labelling versions was abandonned and replaced by a system whereby new features are released annually so we have ECMAScript 2020, ECMAScript 2021, ECMAScript 2022 and so on."))
article.append(addParagraph("You should remember that ECMASCript is the standard, not the language. For example, JavaScript is a version of ECMAScript that fully implements (as far as I am aware) the standard."))
article.append(addHeader("Staying Up to Date with New Releases"))
article.append(addParagraph("ECMA has a website which provides a lot of useful information about the standards which you can find here. If you want to look at what is happening right now, you can check out the TC39 repo on GitHub which shows the most recent proposals and you can view the code there as well or you can download it."))
article.append(addParagraph("This isn't something you need to know about in order to use JavaScript effectively but you may find it interesting and it can give you some insight into what is coming up in the language."))
article.append(addHeader("Understanding Browser Support"))
article.append(addParagraph("As we know, it is the responsibility of the organisations who produce browers to implement JavaScript in that browser. This isn't much of an issue nowadays because most browsers provide pretty comprehensive coverage, but it is still worth knowing where to look for more information, especially if you are working with the very latest features of JavaScript. A good starting point for that is the ECMAScript Compatibility table that provides a fairly comprehensive overview of the support that browsers and other things such as compilers provide for ECMAScript."))
article.append(addParagraph("Another useful resource which allows you to check on individual features of Javascript and how well they are covered is caniuse.com. This shows for a particular feature not only which browsers support it, but also in which versiond it is supported and also provides an estimated percentage of browsers in use that support that feature."))
main.append(menu("ecmascript"))