SHOW:
|
|
- or go back to the newest paste.
| 1 | Function.prototype.myBind = function(context) {
| |
| 2 | - | if (typeof this == "object") {
|
| 2 | + | |
| 3 | - | for (var prop in this) {
|
| 3 | + | |
| 4 | - | if (this.hasOwnProperty(prop) && typeof this[prop] == "function") {
|
| 4 | + | |
| 5 | return this.apply(context, args); | |
| 6 | }; | |
| 7 | } |