MYVAR
与MyVar
和myvar
。可以有多个具有相同名称但不同外壳的不同变量。强烈建议您为清晰起见, 不要使用此语言功能。 var someVariable;
var anotherVariableName;
var thisVariableNameIsSoLong;
studlyCapVar
已定义且值为10
testString: 'assert(typeof studlyCapVar !== "undefined" && studlyCapVar === 10, "studlyCapVar
is defined and has a value of 10
");'
- text: properCamelCase
已定义且值为"A String"
testString: 'assert(typeof properCamelCase !== "undefined" && properCamelCase === "A String", "properCamelCase
is defined and has a value of "A String"
");'
- text: titleCaseOver
已定义,其值为9000
testString: 'assert(typeof titleCaseOver !== "undefined" && titleCaseOver === 9000, "titleCaseOver
is defined and has a value of 9000
");'
- text: studlyCapVar
应该在声明和赋值部分使用camelCase。
testString: 'assert(code.match(/studlyCapVar/g).length === 2, "studlyCapVar
should use camelCase in both declaration and assignment sections.");'
- text: properCamelCase
应该在声明和赋值部分使用camelCase。
testString: 'assert(code.match(/properCamelCase/g).length === 2, "properCamelCase
should use camelCase in both declaration and assignment sections.");'
- text: titleCaseOver
应该在声明和赋值部分使用camelCase。
testString: 'assert(code.match(/titleCaseOver/g).length === 2, "titleCaseOver
should use camelCase in both declaration and assignment sections.");'
```