* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
1.2 KiB
1.2 KiB
id, title, challengeType, videoUrl, dashedName
id | title | challengeType | videoUrl | dashedName |
---|---|---|---|---|
587d825b367417b2b2512c8d | 创建ES6 JavaScript地图 | 1 | create-an-es6-javascript-map |
--description--
新版本的JavaScript为我们提供了一个内置的Map对象,它提供了我们在上一次挑战中手工编写的大部分功能。此Map对象虽然与常规JavaScript对象类似,但它提供了一些普通对象缺少的有用功能。例如,ES6 Map跟踪添加到其中的项目的插入顺序。以下是其方法的更完整概述: .has(key)
基于键的存在返回true或false .get(key)
返回与键相关联的值.set(key, value)
设置新键,值对.delete(key)
删除一个键,值对.clear()
删除所有键值对.entries()
以插入顺序返回所有键的数组.values()
返回插入中所有值的数组order说明:定义一个JavaScript Map对象并为其分配一个名为myMap的变量。添加密钥,值对freeCodeCamp
, Awesome!
它。
--hints--
myMap对象存在。
assert(typeof myMap === 'object');
myMap包含键值对freeCodeCamp
, Awesome!
。
assert(myMap.get('freeCodeCamp') === 'Awesome!');
--seed--
--seed-contents--
--solutions--
// solution required