为什么在此代码中出现错误?

问题描述:

为什么此代码返回错误。为什么在此代码中出现错误?

var old_newOther = newOther; 
consoleParse = function(e){ 
    old_newOther(e); 
} 
(function($) { 
newOther = function(e){ 
    for(var k in e){ 
    if(isset(e[k].onMouseDown)){ 
     TalkWithNPC(e[k].id); 
    } 
    } 
    return e; 
}})(jQuery); 

VM413:29 Uncaught TypeError: (intermediate value)(...) is not a function(…)

你忘了之前的函数表达式地内陷式;

配售(...)函数表达式consoleParse =后立即(功能(E){ old_newOther(E); })将调用函数与您指定的参数。

这就是为什么不建议使用自动分号插入的原因。始终以;结束您的陈述。

+0

这是相同的问题,在 http://stackoverflow.com/questions/36278393/typeerror-intermediate-value-is-undefined –