Consider the following code, using ECMAScript5\'s Object.defineProperty feature:
var sayHi = function(){ alert(\'hi\'); };
var defineProperty =
I don't think there's a better way than a direct feature test with try/catch. This is actually exactly what IE team itself recommends in this recent post on transitioning to ES5 API.
You can shorten the test to just something like Object.defineProperty({}, 'x', {}) (instead of using Array.prototype) but that's a minor quibble; your example tests exact functionality (and so has less chance of false positives).