In functional programming, which statement is true about loops?
a) Loops are commonly used
b) Loops are replaced with recursion or higher-order functions like map or reduce
c) Loops modify global state
d) Loops are used to introduce side effects
Answer:
b) Loops are replaced with recursion or higher-order functions like map or reduce
Explanation:
In functional programming, loops are typically replaced with recursion or higher-order functions like map and reduce to iterate over data structures.