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 d
You can use Object.getOwnPropertyDescriptor(obj, prop).
function isGetter (obj, prop) { return !!Object.getOwnPropertyDescriptor(obj, prop)['get'] }
Usage:
obj = { foo: 'foo', get bar() { return 'bar' } } isGetter(obj, 'bar') // will return true isGetter(obj, 'foo') // will return false