ES6 - Tutorialspoint

2y ago
135 Views
10 Downloads
4.00 MB
435 Pages
Last View : 20d ago
Last Download : 3m ago
Upload by : Mya Leung
Transcription

ES6

ES6About the TutorialEuropean Computer Manufacturers Association (ECMAScript) or (ES) is a standard forscripting languages like JavaScript, ActionScript and JScript. It was initially created tostandardize JavaScript, which is the most popular implementation of ECMAScript. Thistutorial adopts a simple and practical approach through JavaScript to describe the newfeatures in ECMAScript 2015 (ES6), ECMAScript 2016 (ES7), ECMAScript 2017(ES8) andECMAScript 2018 (ES9).AudienceThis tutorial is designed for the stemplate oftware programmers who have already workedwith JavaScript and wishes to gain in-depth knowledge about the ECMAScript. The tutorialwill give you enough understanding on the functionalities of ECMAScript and also aboutES6, ES7, ES8 and ES9.PrerequisitesAn understanding of JavaScript programming concepts is necessary to gain maximumknowledge from this tutorial.Disclaimer & Copyright Copyright 2019 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I)Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republishany contents or a part of contents of this e-book in any manner without written consentof the publisher.We strive to update the contents of our website and tutorials as timely and as precisely aspossible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt.Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of ourwebsite or its contents including this tutorial. If you discover any errors on our website orin this tutorial, please notify us at contact@tutorialspoint.com.i

ES6Table of ContentsAbout the Tutorial .iAudience .iPrerequisites .iDisclaimer & Copyright.iTable of Contents . ii1.ES6 OVERVIEW . 1JavaScript .1ECMAScript Versions .12.ES6 ENVIRONMENT . 3Local Environment Setup.3Installation on Windows .3Installation on Mac OS X .4Installation on Linux .5Integrated Development Environment (IDE) Support .5Visual Studio Code .5Brackets .83.ES6 SYNTAX . 11Whitespace and Line Breaks . 12Comments in JavaScript . 12Your First JavaScript Code . 13Executing the Code. 13Node.js and JS/ES6 . 14The Strict Mode. 14ES6 and Hoisting. 15ii

ES64.ES6 VARIABLES . 16Type Syntax . 16JavaScript and Dynamic Typing . 17JavaScriptVariable Scope . 17The Let and Block Scope . 18let and block level safety . 19let and multiple blocks . 19The const. 20Constants are Immutable . 21const and arrays . 21The var keyword . 22var and hoisting . 22var and block scope . 23var and block level safety . 235.ES6 OPERATORS . 25Arithmetic Operators . 25Relational Operators . 27Logical Operators . 28Bitwise Operators . 29Assignment Operators. 31Miscellaneous Operators . 326.ES6 DECISION MAKING . 37The if Statement. 37The if else Statement. 39The else if Ladder . 40The switch case Statement . 41iii

ES67.ES6 LOOPS . 45Definite Loop. 45Indefinite Loop . 48The Loop Control Statements . 51Using Labels to Control the Flow . 528.ES6 FUNCTIONS . 55Classification of Functions . 55Rest Parameters . 60Anonymous Function . 60The Function Constructor . 61Recursion and JavaScript Functions . 62Lambda Functions . 63Function Expression and Function Declaration . 64Function Hoisting . 65Immediately Invoked Function Expression . 65Generator Functions . 67Arrow Functions . 68Arrow Function Syntax . 69Array.prototype.map() and arrow function . 71Arrow function and “this” . 729.ES6 EVENTS . 74Event Handlers . 74onclick Event Type. 74onsubmitEvent Type . 75onmouseover and onmouseout . 76HTML 5 Standard Events . 76iv

ES610. ES6 COOKIES . 83How It Works?. 83Storing Cookies . 83Reading Cookies . 85Setting Cookies Expiry Date . 86Deleting a Cookie . 8711. ES6 PAGE REDIRECT . 89JavaScript Page Redirection . 89Redirection and Search Engine Optimization . 9012. ES6 DIALOG BOXES . 91Alert Dialog Box . 91Confirmation Dialog Box . 92Prompt Dialog Box . 9313. ES6 VOID KEYWORD . 95Void and Immediately Invoked Function Expressions . 95Void and JavaScript URIs . 9514. ES6 PAGE PRINTING . 9715. ES6 OBJECTS . 98Object Initializers . 98The Object() Constructor . 99Constructor Function. 101The Object.create Method . 103The Object.assign() Function . 103Deleting Properties . 105Comparing Objects . 105v

ES6Object De-structuring . 10616. ES6 NUMBER . 110Number Properties. 110EPSILON . 111MAX SAFE INTEGER . 111MAX VALUE . 111MIN SAFE INTEGER . 112MIN VALUE. 112Nan . 113NEGATIVE INFINITY . 113POSITIVE INFINITY . 114Number Methods . 114Number.isNaN() . 115Number.isFinite. 115Number.isInteger() . 116Number.isSafeInteger() . 116Number.parseInt() . 117Number.parseFloat() . 117Number Instances Methods . 118toExponential() . 118toFixed() . 119toLocaleString() . 120toPrecision() . 120toString() . 121valueOf() .

ES6 i About the Tutorial European Computer Manufacturers Association (ECMAScript) or (ES) is a standard for scrip

Related Documents:

JavaScript versions ECMAScript (also called ES) is the official name of JavaScript (JS) standard ES6, ES2015, ES2016 etc. are implementations of the standard All browsers used to run ECMAScript 3 ES5, and ES2015 ( ES6) were huge versions of JavaScript Then, yearly release cycles started

JavaScript versions ECMAScript (also called ES) is the official name of JavaScript (JS) standard ES6, ES2015, ES2016 etc. are implementations of the standard All browsers used to run ECMAScript 3 ES5, and ES2015 ( ES6) were huge versions of JavaScript Then, yearly release cycles started

If Node.js is configured properly, "Hello, World!" will be displayed. What Is Node and When Should I Use It? 15. Node.js Has Excellent ES6 Support As can be seen on thiscompatibility table, Node has excellent support for ES6. As you're only targeting one runtime (a specific version of the V8 engine), this

tutorialspoint.com or google.com these are domain names. A domain name has two parts, TLD (Top Level Domain) and SLD (Second level domain), for example in tutorialspoint.com, tutorialspoint is second level domain of TLD .com, or you can say it's a subdomain of .com TLD. There are many top level domains available, like .com,

tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the

tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the

tutorialspoint.com or this tutorial may not be redistributed or reproduced in any way, shape, or form without the written permission of tutorialspoint.com. Failure to do so is a violation of copyright laws. This tutorial may contain inaccuracies or errors and tutorialspoint provides no guarantee regarding the

British Biology Olympiad Past paper (120 minutes) 61 - Gold medal 56 - Silver medal 51 - Bronze medal 47 - Highly Commended 41 – Commended The first round of the 2015 competition will consist of two 60 minute papers. 2 1. All of the following are factors influencing membrane fluidity except which one? A. Number of double bonds in the lipids B. Temperature C. Flip-flop movement of lipids D .