Functions Flashcards

1
Q

What is a pure function?

A

Given the same input, it always returns the same output.

It doesn’t produce any side effects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a side effect

A

A side effect refers to any application state change that is observable outside the called function other than its return value. This includes (but is not limited to) modifying global variables, changing input parameters, writing to databases, and interacting with the DOM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly