Filter

The filter is the same as the map, but if the function applied here returns true, then it will move to the new array, or if the function returns false then that item will not be in the array. Suppose I want to extract only the odd numbers from the following array and place them…Continue reading Filter

Map

The map() method creates a new array with the results of calling a provided function on every element in the calling array Suppose you have an array: var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]; Now you want to find the square of each item in this array. So what you…Continue reading Map

Javascript ES6 – Map

Javascript’s ES6 has nothing quite new in our eyes without syntax differences, or syntactic sugar. But this time we will discuss something completely new. Yes this thing has been added to ES6 completely new. It never existed in any previous version of JavaScript. That’s the map Map. Do not mistake this map Mapas a map map. The reason mapis a method. But the map we Mapwill talk…Continue reading Javascript ES6 – Map