Normal Function
- Inside of a regular JavaScript function, this value (aka the execution context) is dynamic.
- The regular function can easily construct objects
- Inside the body of a regular function, arguments is a special array-like object containing the list of arguments with which the function has been invoked.
Arrow Function
- The behavior of this inside of an arrow function differs considerably from the regular function's this behavior. The arrow function doesn't define its own execution context.
- Arrow function cannot be used as a constructor.
- On the other side, no arguments special keyword is defined inside an arrow function.
* Map
The map() method is used for creating a new array from an existing one, applying a function to each one of the elements of the first array.
* ForEach
The forEach() array method loops through any array, executing a provided function once for each array element in ascending index order. This function is referred to as a callback function.
* Filter
The filter() method takes each element in an array and it applies a conditional statement against it. If this conditional returns true, the element gets pushed to the output array. If the condition returns false, the element does not get pushed to the output array.
* Find
The find() method is an Array.prototype method which takes in a callback function and calls that function for every item within the bound array. When the callback function evaluates to true, the method returns the current item and breaks the loop. It returns just the first match – any other matches present inside of the array will be ignored.
The Uses Of Template Literals/Strings in Javascript are :
- Multi Line strings can easily be written using template literals.
- Template literals provide an easy way to interpolate variables and expressions into strings.
- Template literals allow variables in strings.
- We can use expressions is strings using Template Literals.