var example = function() {
console.log(typeof this);
return this;
};
在嚴格模式:example.call('test') # prints 'string' 否則,example.call('test') # prints 'object' 然而,console.log(example.call('te
在我的應用程序中,我試圖將對話框的文本輸入值更新到主控制器中。主控制器中的 $scope.dialogText設置爲對話框的文本輸入。 說,我在對話框中輸入pumpkin,然後按確定,我的應用程序必須顯示, Dialog box's text comment is pumpkin
相反,它總是顯示, Dialog box's text comment is
的jsfiddle是,http:
我曾經寫過"use strict";作爲JavaScript文件中的第一行來啓用嚴格模式。現在我不想將此作爲樣板代碼添加到當前NodeJs包的超過200個JavaScript文件中。 有沒有辦法強迫我包的所有文件,嚴格的模式,而不迫使它爲我包的依賴? 編輯:這已被標記兩倍的一般問題有關how to force strict mode in node的重複。這不是重複的,因爲這個問題的限制性要強大得