Combining some and every
Combining some and every
some and every both return booleans, but they answer opposite collection questions. One asks whether at least one item passes. The other asks whether all items pass.
Real status summaries often need both answers. A release can have a blocker even when most checks are approved, and it should not be marked fully approved until every required check passes.
Your task: Complete getReleaseStatus so it returns an object with hasBlockers and allApproved. A blocker is any check with status: "blocked". All approved means every check has status: "approved". For an empty check list, allApproved should be false.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Combining some and every
some and every both return booleans, but they answer opposite collection questions. One asks whether at least one item passes. The other asks whether all items pass.
Real status summaries often need both answers. A release can have a blocker even when most checks are approved, and it should not be marked fully approved until every required check passes.
Your task: Complete getReleaseStatus so it returns an object with hasBlockers and allApproved. A blocker is any check with status: "blocked". All approved means every check has status: "approved". For an empty check list, allApproved should be false.