Namespace: defProp

just.defProp(objectnon-null, key, valueopt, non-null)

Alternative to Object.defineProperty with more enhancements. If object contains any other key that's not a valid attribute for a property descriptor the value WON'T be used as a property descriptor. I.e: defineProperty({}, 'property', { value: 1, other: 'value' }).property; // > {value: 1, other: 'value'} Note: Empty objects will be considered values rather than property descriptors.
Source:
core.js, line 648

Parameters:

Name Type Default Description
object
object The target.
key
string Key for the property.
value
[optional]
object {value} A propertyDescriptor or some value.
Throws:
Object.defineProperty exceptions.
Returns:
object.