Questions
5.1 Generating HTML code, with restrictions: Using the filter()
→ map()
→ reduce()
sequence is quite common (even though sometimes you won’t use all three), and we’ll come back to this in the Functional design patterns section of Chapter 11, Implementing Design Patterns. The problem here is how to use those functions (and no others!) to produce an unordered list of elements (<ul>...</ul>
) that can later be used onscreen. Your input is an array of characters such as the following (does the list date me?), and you must produce a list of each name that corresponds to chess or checkers players:
const characters = [ { name: "Fred", plays: "bowling" }, { name: "Barney", plays: "chess" }, { name: "Wilma", plays: "bridge" }, { name: "Betty", plays: "checkers" }, . . . &...