javascript (6)

JavaScript advanced features

New Features New versions of JavaScript, such as ES6, ES2016, 2017, etc., come with many new features, however it is still ECMAScript Many of the new features are syntactic sugar or extend the functionality only marginal Template Literals Template literals are string literals with support…

Continue reading...

JavaScript and the browser

The DOM Based on the received HTML document the browser builds up a model of the document structure, the Document Object Model (DOM) The DOM has a tree structure and each node of the document is represented by an object The browser renders the page…

Continue reading...

JavaScript objects

Object An object is a collection of properties A property has a name and a value An object can be seen as associative array (map) where the keys in the array are the names of the object’s properties // Create object as literal const bob…

Continue reading...

JavaScript arrays

Array An array combines multiple values in a single variable Arrays are helpful if the number of values is huge or dynamic Each value of an array has a unique numerical index // Normal variables hold exactly one value const colorA = "blue"; const colorB…

Continue reading...

JavaScript functions

Function Expression A function expression starts with the keyword function followed by the function arguments in parentheses and the function body in curly braces: const square = function(x) { return x * x; }; console.log(square(4)); // >> 16 Function Scope Each function defines a scope…

Continue reading...