Everyone knows that JavaScript is widely used and one of the most famous programming languages. There are a lot of development frameworks based on JS. In JavaScript, we can classify features depending on ECMA scripts. Generally, for a task or a problem, optimized solutions help us to deliver efficient applications development. JS features help us to formulate valuable solutions with proper syntax and better code logics. Here, we will discuss a few features of JavaScript that we probably forget to use. Also, you will get to know how to implement it effortlessly. Here are the top 15 javascript features that are rarely used.

1) Exponentiation ** Operator

This operator is used to find the exponent of a number. Like finding the power of a number raised to a certain degree.

In Math, if we 2 raise to the power of 3.

2 * 2 * 2 // Output => 8

We can do the same in JS using the ** operator:

2**3 // Output => 8

9**3 // Output => 729

2) Reducing Array contents using the length property

The length property in an array indicates the number of elements in the array.

var myArr = [11, 22, 33];

myArr.length // Output => 3

Defining length property JS engines reduce or increase the elements to equal the value of the length property.

var myArr = [11, 22, 33];

myArr.length // Output => 3

myArr.length = 2

myArr // Output => [ 11,22 ]

myArr.length = 4

myArr // [ 11,22, <2 empty items> ]

The elements in the arr were only two. Then, we increased the length to 4. So, 2 more items were added to make the contents 4 in number.

#javascript #js #programming

15 JavaScript Features You’ve Probably Never Used
2.15 GEEK