+
),您可以将一个或多个变量插入到正在构建的字符串中。 myName
设置为等于您的名字的字符串,并在字符串"My name is "
和" and I am well!"
之间用myName
构建myStr
" and I am well!"
myName
应设置为至少3个字符长的字符串
testString: assert(typeof myName !== 'undefined' && myName.length > 2);
- text: 使用两个+
运算符在其中构建myStr
with myName
testString: assert(code.match(/["']\s*\+\s*myName\s*\+\s*["']/g).length > 0);
```