* 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
1.6 KiB
1.6 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
56533eb9ac21ba0edf2244b9 | Constructing Strings with Variables | 1 | 用变量构造字符串 |
Description
+
),您可以将一个或多个变量插入到正在构建的字符串中。 Instructions
myName
设置为等于您的名字的字符串,并在字符串"My name is "
和" and I am well!"
之间用myName
构建myStr
" and I am well!"
Tests
tests:
- text: <code>myName</code>应设置为至少3个字符长的字符串
testString: assert(typeof myName !== 'undefined' && myName.length > 2);
- text: 使用两个<code>+</code>运算符在其中构建<code>myStr</code> with <code>myName</code>
testString: assert(code.match(/["']\s*\+\s*myName\s*\+\s*["']/g).length > 0);
Challenge Seed
// Example
var ourName = "freeCodeCamp";
var ourStr = "Hello, our name is " + ourName + ", how are you?";
// Only change code below this line
var myName;
var myStr;
After Test
console.info('after the test');
Solution
// solution required