Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* 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>
2021-01-12 19:31:00 -07:00

1.2 KiB
Raw Blame History

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