, specificObject.sections , defaults, . {}, defaults.sections. specificObject.sections .
ownProperty specificObject, :
'use strict'
var defaults = {
name: 'def name',
sections: {
1: {
secName: 'def sec name'
}
}
};
Object.freeze(defaults);
var specificObject = Object.create(defaults);
Object.defineProperty(specificObject, 'sections',{
enumerable: true,
writable: true,
configurable: true,
value: {}
});
console.log(specificObject.hasOwnProperty('sections'));
specificObject.sections['1'] = Object.create(defaults.sections['1']);
:
obj.prop = val, javascript obj , , obj. , / val . , obj . prop prototype, obj val.
, prop , , . , .:)
EDIT:
@KubaWyrostek specificObj.sections = {}, , , , , , . .