← Back to challenges

Equality of 3 Values

JavaScriptHardalgorithmsconditionsnumbers

Instructions

Create a function that takes three integer arguments (a, b, c) and returns the amount of integers which are of equal value.

Examples

equal(3, 4, 3) ➞ 2

equal(1, 1, 1) ➞ 3

equal(3, 4, 1) ➞ 0

Notes

Your function must return 0, 2 or 3.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Reverse Words Starting With a Particular Letter