Как заменить прототип 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 = {}

Следующая строка повреждена -, как исправить?

"lorem ipsum".replaceOriginal(/(orem |um)/g,'')
7
задан Billy Moon 7 April 2012 в 20:06
поделиться