the following is a timer object that will report an error in strict mode. Does the boss know how to modify it?
var Timing = function(fun,interval){
this.fun = fun;
this.interval = interval*1000;
this.timer;
}
Timing.prototype = {
constructor: Timing,
setTime: function(){
var that = this;
var fun = that.fun;
that.timer = setTimeout(function(){
fun();
that.timer = setTimeout(arguments.callee,that.interval);
},that.interval);
},
clearTime: function(){
clearTimeout(this.timer)
}
}
var time = new Timing(function(){
console.log("hello");
},1);
time.setTime();
console error: Uncaught TypeError: "caller"," callee", and "arguments" properties may not be accessed on strict mode functions or the arguments objects for calls to them