2018-10-10 22:03:03 +00:00
|
|
|
---
|
|
|
|
id: 587d8255367417b2b2512c72
|
|
|
|
title: Use .has and .size on an ES6 Set
|
|
|
|
challengeType: 1
|
|
|
|
videoUrl: ''
|
|
|
|
localeTitle: ''
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
undefined
|
|
|
|
|
|
|
|
## Instructions
|
|
|
|
undefined
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
tests:
|
|
|
|
- text: ''
|
2018-10-25 07:47:48 +00:00
|
|
|
testString: 'assert((function(){var test = checkSet([4,5,6], 3); test === [ false, 3 ]})(), "<code>checkSet([4, 5, 6], 3)</code> should return [ false, 3 ]");'
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Challenge Seed
|
|
|
|
<section id='challengeSeed'>
|
|
|
|
|
|
|
|
<div id='js-seed'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
function checkSet(arrToBeSet, checkValue){
|
|
|
|
|
|
|
|
// change code below this line
|
|
|
|
|
|
|
|
// change code above this line
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
checkSet([ 1, 2, 3], 2); // Should return [ true, 3 ]
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Solution
|
|
|
|
<section id='solution'>
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|
|
|
|
</section>
|