Reference Every

  • Returns a boolean response if a value in the arrays meets the criteria.
  • This will run for every element of the array as all have to true or false.
  • W3Schools Documentation Array Every

Example - Does every todo have an id? Yes
WDS Video on this Hook
fetch("https://jsonplaceholder.typicode.com/todos") .then((response) => response.json()) .then((todos) => { let checked = false; checked = todos.every((t) => t.id); console.log(todos, checked); });