Javascript对象

109 阅读1分钟

MDN中对js对象的解释: An object is a collection of related data and/or functionality (which usually consists of several variables and functions — which are called properties and methods when they are inside objects.)

js中没有类的概念,不过有对象的概念。

这样的定义就是一个对象:

var person = {};

var person = new Object();

参考自:

developer.mozilla.org/en-US/docs/…