62 lines
1.4 KiB
Markdown
62 lines
1.4 KiB
Markdown
---
|
|
id: 587d7dab367417b2b2512b6f
|
|
title: Use the some Method to Check that Any Elements in an Array Meet a Criteria
|
|
challengeType: 1
|
|
videoUrl: ''
|
|
localeTitle: 'Используйте некоторый метод для проверки того, что любые элементы в массиве соответствуют критериям'
|
|
---
|
|
|
|
## Description
|
|
undefined
|
|
|
|
## Instructions
|
|
undefined
|
|
|
|
## Tests
|
|
<section id='tests'>
|
|
|
|
```yml
|
|
tests:
|
|
- text: ''
|
|
testString: 'assert(code.match(/\.some/g), "Your code should use the <code>some</code> method.");'
|
|
- text: ''
|
|
testString: 'assert(checkPositive([1, 2, 3, -4, 5]), "<code>checkPositive([1, 2, 3, -4, 5])</code> should return <code>true</code>.");'
|
|
- text: '<code>checkPositive([1, 2, 3, 4, 5])</code> должен возвращать <code>true</code> .'
|
|
testString: 'assert(checkPositive([1, 2, 3, 4, 5]), "<code>checkPositive([1, 2, 3, 4, 5])</code> should return <code>true</code>.");'
|
|
- text: ''
|
|
testString: 'assert(!checkPositive([-1, -2, -3, -4, -5]), "<code>checkPositive([-1, -2, -3, -4, -5])</code> should return <code>false</code>.");'
|
|
|
|
```
|
|
|
|
</section>
|
|
|
|
## Challenge Seed
|
|
<section id='challengeSeed'>
|
|
|
|
<div id='js-seed'>
|
|
|
|
```js
|
|
function checkPositive(arr) {
|
|
// Add your code below this line
|
|
|
|
|
|
// Add your code above this line
|
|
}
|
|
checkPositive([1, 2, 3, -4, 5]);
|
|
|
|
```
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
## Solution
|
|
<section id='solution'>
|
|
|
|
```js
|
|
// solution required
|
|
```
|
|
</section>
|