Learn Something & Grow your knowledge

Var

By declaring a object using var keyword, we can reassign and redeclared that variable.

Let

By declaring a object using let keyword, we can reassign the value but we can not redeclared that variable again.

Const

By declaring a object using const keyword, we can not reassign and redeclared that variable.

Normal function

Regular functions created using function declarations or expressions are constructible and callable. Since regular functions are constructible, they can be called using the new keyword.

Arrow function

The arrow functions are only callable and not constructible, i.e arrow functions can never be used as constructor functions. Hence, they can never be invoked with the new keyword.

Map method

Map like filter & foreach takes a callback and run it against every element on the array but whats makes it unique is it generate a new array based on your existing array.

forEach method

Foreach takes a callback function and run that callback function on each element of array one by one.

filter method

Filter executes the callback and check its return value. If the value is true element remains in the resulting array but if the return value is false the element will be removed for the resulting array.

find method

When you want to select a single element from an array, then you can use find method. It will return you the first matching result.

Template literals:

Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, for string interpolation with embedded expressions, and for special constructs called tagged templates. Template string is used for accessing variable dynamically. We can display output in multiple lines.