1.4 KiB
1.4 KiB
id, title, challengeType, videoUrl, localeTitle
| id | title | challengeType | videoUrl | localeTitle |
|---|---|---|---|---|
| 587d8255367417b2b2512c73 | Use Spread and Notes for ES5 Set() Integration | 1 | Use Spread and Notes para la integración de ES5 Set () |
Description
... ? ... puede tomar objetos iterables en ES6 y convertirlos en matrices. Vamos a crear un Set, y echa un vistazo a la función de propagación. var set = new Set ([1,2,3]);
var setToArr = [... set]
console.log (setToArr) // devuelve [1, 2, 3]
Instructions
checkSet . Debe devolver una matriz que contenga los valores del conjunto. Ahora que aprendió a usar el objeto Set() ES6, ¡buen trabajo! Tests
tests:
- text: ¡Tu Set fue devuelto correctamente!
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!");'
Challenge Seed
function checkSet(set){
// change code below this line
// change code above this line
}
Solution
// solution required