1.4 KiB
1.4 KiB
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d8255367417b2b2512c73 | Use Spread and Notes for ES5 Set() Integration | 1 | Use Spread e Notes para Integração do Conjunto ES5 () |
Description
...
? ...
pode levar objetos iteráveis no ES6 e transformá-los em matrizes. Vamos criar um conjunto e verificar a função de propagação. var set = new Set ([1,2,3]);
var setToArr = [... set]
console.log (setToArr) // retorna [1, 2, 3]
Instructions
checkSet
. Deve retornar uma matriz contendo os valores do conjunto. Agora você aprendeu com sucesso como usar o objeto ES6 Set()
, bom trabalho! Tests
tests:
- text: Seu conjunto foi devolvido corretamente!
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