1.6 KiB
1.6 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
bd7123c9c441eddfaeb4bdef | Comment Your JavaScript Code | 1 | 评论您的JavaScript代码 |
Description
//
将告诉JavaScript忽略当前行上的其余文本: //这是一个内嵌评论。您可以使用
/*
开头并以*/
结尾的多行注释: /* 这是一个最佳实践
多行评论* /
在编写代码时,应定期添加注释以阐明代码部分的功能。良好的评论可以帮助传达您的代码的意图 - 包括他人和未来的自我。
Instructions
Tests
tests:
- text: 创建一个包含至少五个字母的<code>//</code>样式注释。
testString: 'assert(code.match(/(\/\/)...../g), "Create a <code>//</code> style comment that contains at least five letters.");'
- text: 创建包含至少五个字母的<code>/* */</code>样式注释。
testString: 'assert(code.match(/(\/\*)([^\/]{5,})(?=\*\/)/gm), "Create a <code>/* */</code> style comment that contains at least five letters.");'
Challenge Seed
Solution
// solution required