Find With Multiple Conditions
Find With Multiple Conditions
find predicates can express more than one condition, but the result is still a single item. The method should stop at the first record that satisfies the full rule.
Import and queue systems often scan logs this way. A failed job may not be retryable, and a retryable job may not be failed, so the predicate must describe the exact intersection the caller needs. The source log should remain unchanged because later diagnostics may still depend on it.
Your task: Complete firstRetryableFailure so it returns the first job whose status is "failed" and whose retryable value is true. Return null when no job matches, and do not mutate the job records.
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.
Find With Multiple Conditions
find predicates can express more than one condition, but the result is still a single item. The method should stop at the first record that satisfies the full rule.
Import and queue systems often scan logs this way. A failed job may not be retryable, and a retryable job may not be failed, so the predicate must describe the exact intersection the caller needs. The source log should remain unchanged because later diagnostics may still depend on it.
Your task: Complete firstRetryableFailure so it returns the first job whose status is "failed" and whose retryable value is true. Return null when no job matches, and do not mutate the job records.