JavaScript Objiects and Prototypes

Create JavaScript Objects

Using Object Literals:  var obj = {name: 'Allen', color: 'White'};

  Dynamic Nature of JavaScript:  obj.age = 3;

Using Constructor Functions:

Using Object.create:

Using ECMAScript6 Classes:

JavaScript Object Properties:

Using Bracket Notation to Access Properties: obj['bracket notation'] = 'a';

Using Properties Descriptors:

Using Writable Attribute:

Using Enumerable Attribute:

Using Configurable Attribute:

Using Getters and Setters:

Prototypes and Inheritance:

原文地址:https://www.cnblogs.com/xiao-hei/p/5075629.html