1.8 KiB
1.8 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
bd7123c9c444eddfaeb5bdef | Declare String Variables | 1 | 声明字符串变量 |
Description
var myName = "your name";
"your name"
被称为字符串 文字 。它是一个字符串,因为它是用单引号或双引号括起来的一系列零个或多个字符。 Instructions
string
变量: myFirstName
和myLastName
并分别为它们分配myFirstName
和myLastName
的值。 Tests
tests:
- text: <code>myFirstName</code>应该是一个至少包含一个字符的字符串。
testString: 'assert((function(){if(typeof myFirstName !== "undefined" && typeof myFirstName === "string" && myFirstName.length > 0){return true;}else{return false;}})(), "<code>myFirstName</code> should be a string with at least one character in it.");'
- text: <code>myLastName</code>应该是一个至少包含一个字符的字符串。
testString: 'assert((function(){if(typeof myLastName !== "undefined" && typeof myLastName === "string" && myLastName.length > 0){return true;}else{return false;}})(), "<code>myLastName</code> should be a string with at least one character in it.");'
Challenge Seed
// Example
var firstName = "Alan";
var lastName = "Turing";
// Only change code below this line
After Test
console.info('after the test');
Solution
// solution required