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