← Back to challenges

Burglary Series (09): Filter Values

JavaScriptHardobjectsloopsarrays

Instructions

The insurance guy calls, the policy you chose doesn't cover values below 5000€, it wouldn't dignify your status you said at the time. Given an object with a list of the stolen items, return a copy of that list without the values below 5000.

Examples

{ tv: 4999, guitar:5000, fork: 5001 } ➞ { guitar:5000, fork: 5001 }

{ tv: 4999 } ➞ {}

{ guitar: 5000 } ➞ { guitar: 5000 }

{} ➞ {}

Notes

N / A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Divide a Fraction by Two