相关疑难解决方法(0)

如何用自定义函数替换javascript原型

// I am trying to make a clone of String's replace function
// and then re-define the replace function (with a mind to
// call the original from the new one with some mods)
String.prototype.replaceOriginal = String.prototype.replace
String.prototype.replace = {}
Run Code Online (Sandbox Code Playgroud)

下一行现在已经破了 - 我该如何解决?

"lorem ipsum".replaceOriginal(/(orem |um)/g,'')
Run Code Online (Sandbox Code Playgroud)

javascript prototype

7
推荐指数
1
解决办法
7764
查看次数

标签 统计

javascript ×1

prototype ×1