I thought this would be as easy as:
if(typeof(Array.push) == \'undefined\'){
//not defined, prototype a version of the push method
// Firefox never gets
And it does work fine in Firefox
That's only by coincidence! You can't generally expect a prototype's method to also exist on the constructor function.
if(typeof(Array().push) == 'undefined')
This was nearly right except you forget new, a perennial JavaScript gotcha. new Array().push, or [].push for short, would correctly check an instance had the method you wanted.