• Janarthanan Soundararajan

A Glimpse of Modern JavaScript - Part 1

Updated: Jan 17

Once a client-side scripting language, but now we can use JavaScript for backend development, mobile application, web, and many more. JavaScript has evolved a lot in the past decade. Its syntax is more modern and easy to use. JavaScript is a dynamic and loosely typed language. But modern JS is more mature; So in this post, we’ll see some important improvements and features of the modern JavaScript.


Arrow Function

Arrow functions are similar to normal functions, but its syntax is a little different. See in the following example.


let and const

'let' and 'const' keywords are used to create the variables in modern Javascript. Variable created using 'let' has a block-level scope and 'const' for creating the constant variable which value cannot be changed.


Spread Operator

Spread operator (...) also called spread syntax using iterable in JavaScript. It helps to expand in places where zero or more than zero elements. Spread operators mostly useful in destructuring.


Template Literals

Before template literals, '+' operator used to concatenate the string and expressions. But we can use the expressions inside the string using the template literals. It also supports multi-line string.


for..of

A loop for iterable objects like Array.


Class

JavaScript does not support Object Orientation, which is a prototype-based language. But we can use the Class just like other Object Oriented languages.


for..in

It is similar to 'for..of' loop which helps to iterate the key-value pair JavaScript Objects. See the following example.

Like this article? Please check out part 2 of the 'A Glimpse of Modern JavaScript'.

  • Promise

  • Async/Await

  • Map and WeakMap

  • Set and WeakSet

A Glimpse of Modern JavaScript - Part 2

I hope the above mentioned Modern JS topics are useful. Thank you for reading!


#JavaScript #es6 #es2015 #programming

469 views4 comments

©2020 by Techaaroorian.

  • Pinterest
  • Twitter Social Icon
  • Facebook
  • YouTube