$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #115

What goes in the blank?

// returns true only if every number is positive
function allPositive(nums: number[]): boolean {
  return nums.____(n => n > 0);
}
// allPositive([1,2,3]) -> true

Answer: every (also accepted: every, every())

every() returns true only when all elements pass the test.
Play Problem Solving ▸