04.js
来自「进行ajax开发sdsd s d sd s」· JavaScript 代码 · 共 14 行
JS
14 行
// Borrow methods from one class for use by another.// The arguments should be the constructor functions for the classes// Methods of built-in types such as Object, Array, Date and RegExp are// not enumerable and cannot be borrowed with this method.function borrowMethods(borrowFrom, addTo) { var from = borrowFrom.prototype; // prototype object to borrow from var to = addTo.prototype; // prototype object to extend for(m in from) { // Loop through all properties of the prototye if (typeof from[m] != "function") continue; // ignore nonfunctions to[m] = from[m]; // borrow the method }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?