3.5 KiB
3.5 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
56533eb9ac21ba0edf2244bb | Word Blanks | 1 | 字空白 |
Description
var sentence =“它真的是”+“热”+“,我们”+“笑”+“自己”+“傻。”;
Instructions
+
来使用提供的变量构建新字符串: myNoun
, myAdjective
, myVerb
和myAdverb
。然后,您将形成的字符串分配给result
变量。您还需要考虑字符串中的空格,以便最后一句话在所有单词之间有空格。结果应该是一个完整的句子。 Tests
tests:
- text: '<code>wordBlanks("","","","")</code>应该返回一个字符串。'
testString: 'assert(typeof wordBlanks("","","","") === "string", "<code>wordBlanks("","","","")</code> should return a string.");'
- text: '<code>wordBlanks("dog", "big", "ran", "quickly")</code>应包含由非单词字符(以及madlib中的任何其他单词)分隔的所有传入单词。'
testString: 'assert(/\bdog\b/.test(test1) && /\bbig\b/.test(test1) && /\bran\b/.test(test1) && /\bquickly\b/.test(test1),"<code>wordBlanks("dog", "big", "ran", "quickly")</code> should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).");'
- text: '<code>wordBlanks("cat", "little", "hit", "slowly")</code>应包含由非单词字符(以及madlib中的任何其他单词)分隔的所有传入单词。'
testString: 'assert(/\bcat\b/.test(test2) && /\blittle\b/.test(test2) && /\bhit\b/.test(test2) && /\bslowly\b/.test(test2),"<code>wordBlanks("cat", "little", "hit", "slowly")</code> should contain all of the passed in words separated by non-word characters (and any additional words in your madlib).");'
Challenge Seed
function wordBlanks(myNoun, myAdjective, myVerb, myAdverb) {
// Your code below this line
var result = "";
// Your code above this line
return result;
}
// Change the words here to test your function
wordBlanks("dog", "big", "ran", "quickly");
After Test
console.info('after the test');
Solution
// solution required