Files
freeCodeCamp/curriculum/challenges/chinese/08-coding-interview-prep/data-structures/remove-items-from-a-set-in-es6.chinese.md
Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* fix: Chinese test suite

Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working.

* fix: ran script, updated testStrings and solutions
2020-03-03 18:49:47 +05:30

1.2 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
587d8254367417b2b2512c71 Remove items from a set in ES6 1 从ES6中的集中删除项目

Description

让我们使用delete方法练习从ES6集中delete 。首先创建一个ES6 Set var set = new Set([1,2,3]);现在使用delete方法从Set中删除一个项目。
set.delete1;
console.log[... set]//应该返回[2,3]

Instructions

现在创建一个整数为1,2,3,4和5的集合。删除值2和5然后返回集合。

Tests

tests:
  - text: '您的集应包含值1,3和4'
    testString: assert((function(){var test = checkSet(); return test.has(1) && test.has(3) && test.has(4) && test.size === 3;})());

Challenge Seed

function checkSet(){
   var set = //Create a set with values 1, 2, 3, 4, & 5
   //Remove the value 2
   //Remove the value 5
   //Return the set
   return set;
}

Solution

// solution required