Let's test your knowledge. Click the correct answer from the options.
Question 1
Classify the given code snippets into pure and impure functions:
Code snippet 1:
SNIPPET
1function average(a, b) {
2 var average = a + b / 2;
3 return average;
4}
Click the option that best answers the question.
- Pure
- Impure