Here you can find the source of clone()
Function.prototype.clone = function() { var that = this; var newFunc = function() { return that.apply(this, arguments); };/*w ww . ja v a 2 s .c o m*/ for (var i in this) { newFunc[i] = this[i]; } return newFunc; };