📜  javascript 字符串原型 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:24.760000             🧑  作者: Mango

代码示例1
/* String prototype all built-in methods:
 * developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
 * -------------------------------------------------------------------------
 */

// Example for *extending* the String prototype
String.prototype.reduce = function () { 
    return this.split().reduce(...arguments);
}