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:

 

 

posted @ 2015-12-25 13:05  小-黑  阅读(256)  评论(0编辑  收藏  举报