From: Intransition Date: 2010-08-01T21:56:46+09:00 Subject: Re: what is the correct way to extend native methods? On Jul 31, 9:19 pm, Maurizio De Santis wrote: > Hello! > > suppose I want to modify Array.slice() (and consequentially, Array[]) in > order to accept a RegExp as argument, and return values matching the > regular expression. I tried to solve this problem in this way: DON'T! It's almost always a bad idea to override a built-in core method. There are likely to be unintended effects that will break other code. The best approach is to define a new method and use that.