Es6 guide Ces -guide Table of Contents Introduction let const arrow functions default rest spread destructuring strings iterators generators classes and inheritance modules promises set map weak Ces -guide ES -guide ECMAScript ES guide CHECK SUMMARY TO SE

Ces -guide Table of Contents Introduction let const arrow functions default rest spread destructuring strings iterators generators classes and inheritance modules promises set map weak Ces -guide ES -guide ECMAScript ES guide CHECK SUMMARY TO SEE TABLE OF CONTENT I want to share with you some thoughts snippets of code and tell you a little about the upcoming ES It ? s my own road to know it before it will be a standard You might have noticed about ES a lot lately This is because the standard is targeting rati ?cation in June See draft - ECMAScript ECMAScript is a signi ?cant update to the language Previous ES was standardized in Frameworks like AngularJS Aurelia ReactJS Ionic start using it today ES includes a lot of new features arrows classes enhanced object literals template strings destructuring default rest spread let const iterators for of generators unicode modules module loaders map set weakmap weakset proxies symbols subclassable built-ins promises math number string object APIs binary and octal literals re ect api Introduction Ces -guide tail calls I will try to describe each of these in the next stories so stay updated Thanks to the use of transpilers Babel Traceur and others we can actually use it right now until browsers fully catch up Browser support matrix ES Repl in Chrome Devl Tools - Scratch JS Future is bright People from the community denounced these words I have only one to add we can handle it easily Introduction Ces -guide let const First topic about ECMAScript is let const If you are familiar with JavaScript you have probably known the term scope If you are not that lucky don't worry about it I'll explain that in a few words below Why I mentioned something about JavaScript scope This is because let and const have a very strong connection with that word Firstly imagine and old way and still valid to declare a new variable in your JS code using ES ES var a if a var b for var c c c ? function letsDeclareAnotherOne var d console log a console log b console log c console log d ReferenceError d is not de ?ned window console log window a console log window b console log window c console log window d unde ?ned We can see that variable a is declared as global Nothing surprising Variable b is inside an if block but in JavaScript it doesn't create a new scope If you are familiar with other languages you can be disappointed but this is JavaScript and it works as you see The next statement is a for loop C variable is declared in this for loop but also in the global scope Until variable d is declared in his own scope It's inside a function and only function creates new scopes Variables in JavaScript are hoisted to the top Hoisting is JavaScript's default behavior of moving all declarations to the top of the current scope to the top of

  • 120
  • 0
  • 0
Afficher les détails des licences
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise
Partager
  • Détails
  • Publié le Aoû 17, 2021
  • Catégorie Law / Droit
  • Langue French
  • Taille du fichier 103.9kB