Javascript “的含义;TypeError:字符串不是函数;
错误“TypeError:string不是函数”的确切含义是什么? 哪些条件触发了错误 显示错误出现位置的小上下文 以下程序Javascript “的含义;TypeError:字符串不是函数;,javascript,node.js,Javascript,Node.js,错误“TypeError:string不是函数”的确切含义是什么? 哪些条件触发了错误 显示错误出现位置的小上下文 以下程序 "use strict;" ((console["log"])(42)); "use strict"; ((console["log"])(42)); 给出了错误 /private/var/folders/k6/grq8nv093hj78x5m172d725m0000gn/T/tmp14388866091438886609658.js:2 ((console["log
"use strict;"
((console["log"])(42));
"use strict";
((console["log"])(42));
给出了错误
/private/var/folders/k6/grq8nv093hj78x5m172d725m0000gn/T/tmp14388866091438886609658.js:2
((console["log"])(42));
^
TypeError: string is not a function
at Object.<anonymous> (/private/var/folders/k6/grq8nv093hj78x5m172d725m0000gn/T/tmp14388866091438886609658.js:2:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
运行时没有任何错误。我认为它认为您正在尝试执行
“使用strict;”
作为函数。尝试在其后面添加分号
我认为它认为您试图将
“使用strict;”“
作为一个函数执行。尝试在其后面添加分号
我认为它认为您试图将
“使用strict;”“
作为一个函数执行。尝试在其后面添加分号
我认为它认为您试图将
“使用strict;”“
作为一个函数执行。尝试在其后面添加分号
"use strict";
((console["log"])(42));