Modern JavaScript with ES6-ES13 (JS-Tutorial)
- Improve your code for websites and web apps with modern JavaScript functions
- Get to know all the practical and useful features of ES6 to ES13 in detail
- Write lean, error-minimized, easily maintainable code
- A 6-hour tutorial by software developer Stephan Haewß
Discover what's new and important for the JavaScript scripting language since ECMAScript 6 - in one comprehensive tutorial!
28 Videos, 394 minutes
Intro to the course
JavaScript ES6-ES13: 1 | What can you expect in the course?
2 minThis is what you can expect in this JavaScript ES6 course.
Introduction
JavaScript ES6-ES13: 2.1 | Why ES6? Can't I stay with good old JavaScript?
7 minJavaScript has been around in browsers for many years. Almost every website contains more or less JS code. Although the first versions were still very bumpy, it has been possible to work quite well with the ES5 standard so far, at least if you were able to avoid the pitfalls and imponderables skillfully. So why learn something new and not stick with the tried and tested? In this lesson, I will show you the advantages of the new ES6 standard and the reasons why you can't really do without it.
JavaScript ES6-ES13: 2.2 | Set up development environment
6 minThis lesson presents one way of setting up a development environment. We use Visual Studio Code from MS as the IDE and ViteJS as the dev server.
ECMAScript: ES6 to ES13 – the new features
JavaScript ES6-ES13: 3.1 | Variable declaration with let and const versus var
19 minUp to and including ES5, the var keyword was the only way to declare variables, and its peculiarities often caused unwanted behavior or even errors. ES6 introduces the two new keywords let and const, which iron out some of var 's shortcomings.
JavaScript ES6-ES13: 3.2 | For loop
13 minEvery web developer is familiar with the For loop. It is also often used to run through arrays. With ES6, there is a variant of the For loop that allows this to be done in a much shorter and more compact way.
JavaScript ES6-ES13: 3.3 | Arrow-Functions
19 minFunctions are essential in JS and were previously only declared and defined using the keyword function. ES6 introduces a very elegant and short notation that not only makes the code more readable, but also offers a solution to a tiresome problem with this.
JavaScript ES6-ES13: 3.4 | Optional function parameters
11 minOptional parameters are somewhat awkward to implement in ES5 and are not revealed to the caller of a function. With ES6, optional parameters and their default values can be written directly into the function signature.
JavaScript ES6-ES13: 3.5 | Destructuring
12 minDestructuring allows the targeted extraction of elements from objects and arrays. On closer inspection, there are many possible applications that make JS code more elegant and compact.
JavaScript ES6-ES13: 3.6 | Rest parameter
7 minUntil ES6, it was necessary to handle the arguments variablein order to allow a variable number of parameters for functions. This is much easier in ES6 with the so-called rest parameters.
JavaScript ES6-ES13: 3.7 | Rest operator
4 minThe ... operatoris not only used for residual parameters in function definitions, it can also be used in array structuring to catch the "rest" of the elements and make them available as an array.
JavaScript ES6-ES13: 3.8 | Rest operator with objects
5 minThe remainder operator can not only be used with arrays, it can also be used with objects to collect the remaining properties and make them available as an object.
JavaScript ES6-ES13: 3.9 | Spread operator for arrays
7 minThe opposite of the remainder operator is the spread operator. It looks the same (...), but is on the other side of an assignment and spreads the array into its individual parts.
JavaScript ES6-ES13: 3.10 | Spread operator for objects
8 minThe "trick" with the spread operator also works very well with objects. It can be used to "mix" objects into other objects. However, there is also a very good alternative for this with Object.assign().
JavaScript ES6-ES13: 3.11 | Method declaration in object literals
3 minFunctions in object literals are very cumbersome to write with the function keyword. With ES6, however, they can also be written in a much shorter and catchier way.
JavaScript ES6-ES13: 3.12 | Useful and new string functions
19 minWorking with strings is a basic tool for every programmer. It's a good thing that ES6 offers some new and very useful string functions that save a lot of typing work.
JavaScript ES6-ES13: 3.13 | Template literals
14 minThere's no other way to put it: up to ES6, multi-line string literals with integrated variable values were a pain and also very unpleasant to read. The new template literals of ES6 are a syntactic blessing.
JavaScript ES6-ES13: 3.14 | Useful new array functions (find, filter, map, reduce ...)
36 minES5 already has some very useful array functions that take a more functional approach. ES6 has added a few others that make working with arrays even more convenient. However, some of the "old" functions already available in ES5 are also acknowledged here.
JavaScript ES6-ES13: 3.15 | Map as dictionary and key value store
16 minObjects could always be used as a key-value store or dictionary, but with some disadvantages. The new map data structure gets rid of these disadvantages and offers solid dictionary functionality, as known from other programming languages.
JavaScript ES6-ES13: 3.16 | Promises
23 minAsynchronous processes can be handled with callback functions, but there is a risk that the nesting depth will be too great and the code will become confusing (the so-called callback hell). Promises solve this problem by bypassing deep nesting and allowing asynchronous processes to be chained on one level.
JavaScript ES6-ES13: 3.17 | Async and await
29 minAfter the callback hell can be avoided with Promises, the async/await constructtakes syntactic sugar one step further. It is based on Promises and allows asynchronous processes to be programmed almost like synchronous ones. Once you have programmed with async/await, you will avoid the direct use of the then methodof Promises (and even more so the use of callbacks).
JavaScript ES6-ES13: 3.18 | Modules
29 minModules have been used in Node.js from the very beginning, but in the beginning it relied exclusively on the CommonJS module format with require. Since ES6, there has been a module definition in the standard and thus the new import/export keywords. This format is now supported by almost all (new) JS libraries, and Node.js can also handle it in the latest versions.
JavaScript ES6-ES13: 3.19 | Dynamic imports
12 minIn addition to the static import of modules with the keyword import, ES6 also supports dynamic import with the import function. As the whole thing works asynchronously, a promise is returned, the resolution of which can be waited for using await. This means that nothing stands in the way of reloading modules at any time during runtime.
JavaScript ES6-ES13: 3.20 | Classes with class
8 minUntil ES6, classic object-oriented programming with classes and inheritance only existed via the detour of a prototype in a constructor function. This was cumbersome, did not appear very compact and was therefore also prone to errors. With ES6, the new keyword class now allows the definition in a compact form, as we know it from other programming languages such as Java, C# and C++. Internally, however, it remains a fundamentally prototype-based system, only with a nicer syntax.
JavaScript ES6-ES13: 3.21 | Inheritance
18 minInheritance is also still based on prototypes, but is much easier and clearer to write in ES6 with the keyword extends. If you use it, you have to call the constructor of the base class with super at the right time. How to do this is of course also explained in this lesson.
JavaScript ES6-ES13: 3.22 | Fields in classes
15 minThe declaration of members or fields has also been made possible with the newer standards. This means that static fields can also be declared and initialized.
JavaScript ES6-ES13: 3.23 | Private fields
9 minPrivate fields can now also be declared, and you are guaranteed not to be able to access them from the outside. The declaration takes a little getting used to, as it is noticeably different from other programming languages.
JavaScript ES6-ES13: 3.24 | Create objects without class
33 minWith the new keyword class and the associated features such as inheritance and data encapsulation (private fields), all OO programmers should be happy, right? In this lesson, I would like to present an alternative for creating objects that works without classes, prototypes and this, but allows a more flexible type of "inheritance" or rather "composition".
Conclusion
JavaScript ES6-ES13: 4 | Summary and outlook
9 minThe most important features of version ES6 and newer should now be covered. However, new features are always being added. Some less frequently used functions have not yet been mentioned. This lesson explains what can still be expected in the future and which functions could still be of interest in special cases.
Comment now „Modern JavaScript with ES6-ES13 (JS-Tutorial)“