All quizzesHard
Composition & Monads
Preview — 3 of 10 questions
Which of the following is a characteristic of a pure function?
AIt relies on external states like global variables.
BIt modifies its input arguments.
CIt always produces the same output given the same input.
DIt always produces random output.
What is the benefit of immutability in functional programming?
AIt allows functions to modify input data directly.
BIt makes the code more complex to understand.
CIt increases the performance of the application.
DIt makes data predictable, reducing the chances of bugs caused by unintended side effects.
Which of the following is an example of a side effect in JavaScript?
AReturning a value from a function.
BModifying a global variable inside a function.
CCalculating a mathematical result.
DAssigning a value to a local variable.
Sign up free to play
Answer all 10 questions (7 more), see explanations for every answer, and track your score.