freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/data-structures/use-spread-and-notes-for-es...

54 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
id: 587d8255367417b2b2512c73
title: Use Spread and Notes for ES5 Set() Integration
challengeType: 1
videoUrl: ''
localeTitle: Использование Spread и Notes для интеграции ES5 Set ()
---
## Description
<section id="description"> Вы помните оператор распространения ES6 <code>...</code> ? <code>...</code> может принимать истребимые объекты в ES6 и превращать их в массивы. Давайте создадим Set и проверим функцию спреда. <blockquote> var set = new Set ([1,2,3]); <br> var setToArr = [... set] <br> console.log (setToArr) // возвращает [1, 2, 3] </blockquote></section>
## Instructions
<section id="instructions"> В этом упражнении мы передадим заданный объект функции <code>checkSet</code> . Он должен возвращать массив, содержащий значения Set. Теперь вы успешно научились использовать объект ES6 <code>Set()</code> , хорошую работу! </section>
## Tests
<section id='tests'>
```yml
tests:
- text: Ваш набор был возвращен правильно!
testString: 'assert((function(){var test = checkSet(new Set([1,2,3,4,5,6,7])); test === [ 1, 2, 3, 4, 5, 6, 7 ]})(), "Your Set was returned correctly!");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function checkSet(set){
// change code below this line
// change code above this line
}
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>