Determine if a JavaScript property has a getter or setter defined?

devios1 picture devios1 · Dec 21, 2011 · Viewed 16.8k times · Source

Is it possible, given an object and property name to determine if that property is defined using either a getter or setter, or is it completely transparent? I only want to define a getter/setter if there is not already one defined on the property.

I need it to work in WebKit/Firefox.

Answer

Graham picture Graham · Dec 21, 2011