1.
实现 function times(fn, n);
使得:
function foo() { alert("hello");}
调用
times(foo, 2);
foo(); // hello
foo(); // hello
foo(); // nothing happend;
2.window对象被污染了,写一段代码找出污染window对象的变量及函数
3. 实现 new ClassA() === new ClassA;
实现 function times(fn, n);
使得:
function foo() { alert("hello");}
调用
times(foo, 2);
foo(); // hello
foo(); // hello
foo(); // nothing happend;
2.window对象被污染了,写一段代码找出污染window对象的变量及函数
3. 实现 new ClassA() === new ClassA;