小编Jos*_*Goh的帖子

为什么不允许√作为objectName/stringName/functionName/NumberName?

我正在编写科学计算器,我需要一些帮助:

function ?(in){
    return Math.sqrt();
}
// throws an error
var ? = function(in){
    return Math.sqrt();
}
// also throws an error

var ? = "sqrt";
?randomSqNum = 100,
?random = {sqrt:4,cubert:8},
?sqNum = ["0","1","4","9","16","25"],
?null = null,
?undefined = undefined;
Run Code Online (Sandbox Code Playgroud)

他们都抛出错误!请解释他们抛出错误的原因.还有,有办法解决这个问题吗?

javascript jquery

1
推荐指数
1
解决办法
85
查看次数

标签 统计

javascript ×1

jquery ×1