← Back to challenges

Exists a Number Higher?

JavaScriptHardhigher_order_functionsarraysvalidation

Instructions

Write a function that returns true if there exists at least one number that is larger than or equal to n.

Examples

existsHigher([5, 3, 15, 22, 4], 10) ➞ true

existsHigher([1, 2, 3, 4, 5], 8) ➞ false

existsHigher([4, 3, 3, 3, 2, 2, 2], 4) ➞ true

existsHigher([], 5) ➞ false

Notes

Return false for an empty array [].

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Reverse Coding Challenge #3