Hello fCC family, what does it mean when the lesson says “Recall that map and filter are special cases of reduce”
Your code so far
// Only change code below this line
function urlSlug(title) {
}
// Only change code above this line
urlSlug("A Mind Needs Books Like A Sword Needs A Whetstone");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.35
Challenge: Functional Programming - Apply Functional Programming to Convert Strings to URL Slugs
The reduce method allows for more general forms of array processing, and it’s possible to show that both filter and map can be derived as special applications of reduce .
Therefore both map and filter are just simplified versions of reduce (you can use reduce to do everything they do plus more)