
Untitled
By: a guest on
May 6th, 2012 | syntax:
None | size: 0.56 KB | hits: 23 | expires: Never
Difference between this property descriptor and property assignment in ECMAScript 5?
var Person = {
firstName: null, // the person’s first name
lastName: null // the person’s last name
};
var Employee = Object.create(Person, {
id: {
value: null,
enumerable: true,
configurable: true,
writable: true
}
});
var Employee = Object.create(Person);
Employee.id = null;
// Or using jQuery.extend
$.extend(Employee, {
id : null
});
obj.prop = val;
Object.defineProperty( obj, 'prop', {
value: val
});