当前位置: 首页 > 图文教程 > 网络编程 > Javascript > JS的Object类的属性和方法

Javascript
form中限制文本字节数js代码
use jscript with List Proxy Server Information
use jscript List Installed Software
List Installed Software Features
List Information About the Binary Files Used by an Application
List the Codec Files on a Computer
List the UTC Time on a Computer
List Installed Hot Fixes
excel操作之Add Data to a Spreadsheet Cell
Add Formatted Data to a Spreadsheet
Apply an AutoFormat to an Excel Spreadsheet
JavaScript语法着色引擎(demo及打包文件下载)
类之Prototype.js学习
一款JavaScript压缩工具:X2JSCompactor
iis6+javascript Add an Extension File
jscript之Open an Excel Spreadsheet
jscript之Read an Excel Spreadsheet
jscript之List Excel Color Values
去除图像或链接黑眼圈的两种方法总结
Add a Formatted Table to a Word Document

Javascript 中的 JS的Object类的属性和方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-28   浏览: 497 ::
收藏到网摘: n/a

本文介绍JavaScript中的Object类具有的属性和方法的使用。

属性:

Constructor:对创建对象的函数的引用(指针)。对于Object类,该指针指向原始的object()函数。

Prototype:对该对象的对象原型的引用。对于所有的类,它默认返回Object对象的一个实例。

方法:

hasOwnProperty(property):判断对象是否有某个特定的属性。必须用字符串指定该属性(例如,o.hasOwnProperty(”name”))。

isPrototypeOf(object):判断该对象是否为另一个对象的原型。

propertyIsEnumerable(property):判断给定的属性是否可以用for…in语句进行枚举。

toString():返回对象的原始字符串表示。对于Object类,ECMA-262没有定义这个值,所以不同的ECMAScriipt实现具有不同的值。

valueOf():返回最适合该对象的原值。对于许多类,该方法返回的值都与toString()的返回值相同。