Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript “的含义;TypeError:字符串不是函数;_Javascript_Node.js - Fatal编程技术网

Javascript “的含义;TypeError:字符串不是函数;

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

错误“TypeError:string不是函数”的确切含义是什么? 哪些条件触发了错误

显示错误出现位置的小上下文

以下程序

"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));