What is the difference between var,let and constant?
Var :The var is the oldest keyword to declare a variable in JavaScript. The scope of the var keyword is the global or function scope. It means variables defined outside the function can be accessed globally, and variables defined inside a particular function can be accessed within the function.
Const :The const keyword has all the properties that are the same as the let keyword, except the user cannot update it. When users declare a const variable, they need to initialize it, otherwise, it returns an error. The user cannot update the const variable once it is declared.
Let: The let keyword is an improved version of the var keyword. The scope of a let variable is only block scoped. It can’t be accessible outside the particular block ({block}).
What is the difference between arrow function and regular function?
What is the difference between map,foreach,filter and find?
Foreach: .forEach() is great we need to execute a function for each individual element in an array.It's returned value is undefined
Map:.map() when we want to transform elements in an array. New array will be created as return value.
Find:.find() When you want to select a single element from an array.
Filter: .filter() when you want to select a subset of multiple elements from an array.It returns array with filtered value