# JavaScript 创建新对象 - 对象的定义

**URL:** <https://www.isharkfly.com/t/javascript/8650>\
**Category:** 前端\
**Created:** [October 27, 2012, 4:15pm UTC](https://www.isharkfly.com/t/javascript/8650 "2012-10-27T16:15:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [October 27, 2012, 4:15pm UTC](https://www.isharkfly.com/t/javascript/8650/1 "2012-10-27T16:15:13Z")

</div>

JavaScript对象的定义，其基本格式如下：  
Function Object（属性表）`
This.prop1=prop1
This.prop2=prop2
...
This.meth=FunctionName1;
This.meth=FunctionName2;
...
`在一个对象的定义中，可以为该对象指明其属性和方法。

通过属性和方法构成了一个对象的实例。

如以下是一个关于University对象的定义：`Function university(name,city,creatDate URL)
This.name=name
This.city=city
This.creatDate=New Date(creatDate)
This.URL=URL`其基本含义如下：

Name－指定一个“单位”名称。

City－“单位”所在城市。

CreatDate－记载university对象的更新日期。

URL－该对象指向一个网址。
