isPrimitive = function isPrimitive(input) {
        var type = typeof input;
        return input === null || (type !== 'object' && type !== 'function');
    }
Brings an environment as close to ECMAScript 5 compliance
as is possible with the facilities of erstwhile engines.

Annotated ES5: http://es5.github.com/ (specific links below)
ES5 Spec: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
Required reading: http://javascriptweblog.wordpress.com/2011/12/05/extending-javascript-natives/