函数中何时使用和不使用单引号或双引号?
例如:
function convertToInteger(str) {
return parseInt(str); // why do we not use double-quotes here? is this as simple as we never use quotes around arguments when calling a function?
}
convertToInteger("56");
函数中的变量称为自变量。它们用来存放你经过的物品。当你传递它时,它将使用你输入的任何值,但如果你把一个值放在引号里,你将设置一个固定值。
变量值应使用引号,变量名称不应使用引号。
convertToInteger("56"(;
或
var datavalue=";56〃;;
convertToInteger(数据值(;