Tutorials on Web Development, Programming, and Web Design

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

Rest parameter in ES6

In Tutorials

In this ES6 example, we define function “adder” with a “rest parameter” called “numbers”.  Note the three dots before the parameter name in the function...

read more

Default function parameters in ES6

In Tutorials

Here is an example of using default function parameters in ES6: You see that the browser displays “Hello John” because we passed in the value “John” into the sayHello...

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.