Functional Programming List Operations
Methods on the array (aka, "list") prototype, so we would naturally refer to them as array or list operations.
👉 Map(..)
👉 Filter(..)
👉 Reduce()
Non-FP List Operations
👉 foreach(..)
👉 some(..)
👉 every()
👉Map : A mapping is a transformation from one value to another value. The map(..) function takes its associated value (an array) and a mapping function (the operator function), and executes the mapping function for each individual value in the array. Finally, it returns a new array with all the newly mapped values in it.
👉Filter: Iterate over list and Filtering in the results that match your criteria, using predicate function and store in a new list. The filter(..) list operation takes a function to decide if each value in the original array should be in the new array or not. This function needs to return true if a value should make it, and false if it should be skipped. A function that returns true/false for this kind of decision making goes by the special name: predicate function.
👉Reduce: A combination/reduction is abstractly defined as taking two values(array list) and making them into one value. The function you pass to reduce(..) to perform the reduction is typically called a reducer. A reducer has a different signature from the mapper and predicate functions we looked at earlier. Reducers primarily receive the current reduction result as well as the next value to reduce it with. The current result at each step of the reduction is often referred to as the accumulator.
En esta página del sitio puede ver el video en línea 😺Functional Programming List Operations📃 de Duración hora minuto segunda en buena calidad , que subió el usuario Functional Programming 07 diciembre 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 29 veces y le gustó 0 a los espectadores. Disfruta viendo!