何时在函数中使用或不使用单引号或双引号?
例如:
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");发布于 2022-03-22 16:42:52
变量值应该在引号中,变量名称不应该在引号中。
convertToInteger("56");
或
datavalue="56";
数据雪崩(ConvertToInteger);
发布于 2022-03-22 16:49:26
函数中的变量称为参数。它们用来存储你传递的物品。当您传递它时,它将使用您输入的任何值,但是如果您将一个值放在引号中,您将设置一个固定的值。
https://stackoverflow.com/questions/71575733
复制相似问题