Example of set in Javascript ES6

In Tutorials

Here is an example of iterating through the values of a set in ES6… Unlike Map, it can only contain unique values.  You add to a set using “add” instead of “set”....

read more

Example of Map in Javascript ES6

In Tutorials

With ES6, we have Map where we can store key value pairs using the “set” method… We get elements out using “get” method.  The map has a property of size to indicate...

read more

Example of for-of block in Javascript ES6

In Tutorials

While in previous tutorials, we used the forEach method to iterate through all the elements of an array; now we can use the for-of construct like this … And you get the results as...

read more

Example of class in Javascript ES6

In Tutorials

Here is an example of a class with constructor in Javascript ES6… The class name “Animal” is typically capitalized.  The instance variable “person” is not.  You...

read more

Destructuring in Javascript ES6

In Tutorials

Here we have an object “john” assigned to “employee”.   If we want to extract out the property value of “name” into a variable “n”.  And the property...

read more

const keyword in Javascript ES6

In Tutorials

The “const” keyword has the same block scope as the “let” keyword as shown in previous tutorial.  With const, whatever was assigned, can not be changed… Note that once...

read more

Arrow functions in Javascript ES6

In Tutorials

Continuing from the last tutorial, we changed the anonymous function in an arrow function like this… This is equivalent to use of anonymous function… but is much more concise. You drop...

read more

Template Strings in Javascript ES6

In Tutorials

To show you template string in Javascript ES6, we continue directly from last tutorial but with one line changed… The result is the same.  Instead of using the single of double quotes to mark...

read more

spread operator in Javascript ES6

In Tutorials

The spread operator in Javascript ES6 uses three dots … It also returns 15 to the browser.   Except that the dot-dot-dot is in the caller and not in the function definition.  The function...

read more

Learn Web Tutorials is hosted by Hostmonster and design based on Wordpress template by Elegant Themes
All contents are opinions and are copyrighted and may contain display ads and ad links for which site may receive revenues from.
See Terms of Use and Privacy Policy.