var example = function() {
console.log(typeof this);
return this;
};
在严格模式:example.call('test') # prints 'string' 否则,example.call('test') # prints 'object' 然而,console.log(example.call('te
我曾经写过"use strict";作为JavaScript文件中的第一行来启用严格模式。现在我不想将此作为样板代码添加到当前NodeJs包的超过200个JavaScript文件中。 有没有办法强迫我包的所有文件,严格的模式,而不迫使它为我包的依赖? 编辑:这已被标记两倍的一般问题有关how to force strict mode in node的重复。这不是重复的,因为这个问题的限制性要强大得