title: Use the every Method to Check that Every Element in an Array Meets a Criteria
challengeType: 1
videoUrl: ''
localeTitle: Use o método Every para verificar se todos os elementos em uma matriz atendem a um critério
---
## Description
<sectionid="description"> O método <code>every</code> funciona com arrays para verificar se <em>cada</em> elemento passa por um teste específico. Retorna um valor booleano - <code>true</code> se todos os valores atendem aos critérios, <code>false</code> se não. Por exemplo, o código a seguir verificaria se cada elemento na matriz de <code>numbers</code> é menor que 10: <blockquote> números var = [1, 5, 8, 0, 10, 11]; <br> numbers.every (function (currentValue) { <br> return currentValue <10; <br> }); <br> // Retorna falso </blockquote></section>
## Instructions
<sectionid="instructions"> Use o método <code>every</code> dentro da função <code>checkPositive</code> para verificar se todos os elementos em <code>arr</code> são positivos. A função deve retornar um valor booleano. </section>
## Tests
<sectionid='tests'>
```yml
tests:
- text: Seu código deve usar o método <code>every</code> .
testString: 'assert(code.match(/\.every/g), "Your code should use the <code>every</code> method.");'