Frequently Asked Questions

var: The scope of a var variable is functional scope.
let: The scope of a let variable is block scope. const :The scope of a const variable is block scope.

Unlike regular functions, arrow functions do not have their own this . The value of this inside an arrow function remains the same throughout the lifecycle of the function and is always bound to the value of this in the closest non-arrow parent function.

The forEach() method does not create a new array based on the given array.
The map() method creates an entirely new array.
The forEach() method returns “undefined“.
The map() method returns the newly created array according to the provided callback function.
filter creates a new array by removing elements that don't belong