Object.prototype.say=function(){
alert("我是顶层的方法");
}
children.prototype=new parent(); parent.prototype.say=function(){
alert('我是父类原型');
} function parent(){
this.say=function(){
alert('我是父类');
}
} children.prototype.say=function(){
alert('我是子类原型')
} function children(){
//****
this.say=function(){
alert('我是子类');
}
}
var one=new children();
alert(one.say); //弹出: *部分

 继承顺序由下到上,需注意之类原型的位置,在继承父类之后.

对象的分类

1.内置对象

1.1、Global

实际上不存在,JavaScript中所有的函数都必须是某个对象的方法。例如  isNaN(),parseInt() 等方法都是Global对象的方法。

1.2、Math( 格式:Math.方法(参数) )

//取绝对值:Math.abs()
var a=-23;
alert(Math.abs(a)); 结果:23 //取近似整数(四舍五入):Math.round()
var a=-2.4;
alert(Math.round()); 结果:2 //取近似整数(下取舍):Math.floor()
var a=2.9;
alert(Math.floor()); 结果:2 //取近似整数(上取舍):Math.ceil()
var a=2.1;
alert(Math.ceil()); 结果:3 //最大值:Math.max()
var a=2.1;var b=3.3
alert(Math.max(a,b)); 结果:3.3 //最小值:Math.min()
var a=2.1;var b=3.3
alert(Math.min(a,b)); 结果:2.1 //随机数(0~1之间):Math.random()
//取0-10之间整数
alert(Math.round(Math.random()*10));

2.本地对象(详细的W3C有介绍,这里就不阐述了)

2.1.Array

2.2.Number

2.3.String

2.4.Boolean

2.5.Function

2.6.RegExp

...

3.宿主对象(之后会有专门的文章介绍这两个对象)

DOM——通过 DOM,可以访问所有的 HTML 元素,连同它们所包含的文本和属性

BOM——浏览器对象模型

最新文章

  1. Entity Framework Code First学习系列目录
  2. Analyzer中进行货币转换
  3. WPF – pass multiple parameters to a Command
  4. Yeoman自动构建js项目
  5. RestTemplate 使用总结
  6. Ajax 完整教程
  7. 【Android - V】之Toolbar的使用
  8. C# 窗口间传递数据
  9. Nis+Nfs+Autofs
  10. 【.NET】发送Email
  11. jq的合成事件
  12. [源代码] SailingEase .NET Resources Tool (.NET 多语言资源编辑器)
  13. Python系列之内置函数
  14. Oracle 存储过程 PROCEDURE
  15. Java Design Pattern(Factory,Singleton,Prototype,Proxy)
  16. 获取spring容器对象方法和原因
  17. 与大家分享学习微信小程序开发的一些心得
  18. JSON.stringify与JSON.parse
  19. Android RealativeLayout 布局gravity不能居中的解决办法
  20. mybatis 操作数据错误Truncated incorrect DOUBLE value: ''

热门文章

  1. S2S:分享出的营销机遇
  2. python pythonic是什么?
  3. HNOI2016 网络
  4. BZOJ 1699: [Usaco2007 Jan]Balanced Lineup排队
  5. Distinguishing Between Embedded and General-Purpose Computing
  6. 【centos6 , 6】linux 查看帮助文档:
  7. POJ 3384 Feng Shui 凸包直径 + 半平面交
  8. 五张图概括 什么是 ASP 、 ASP.NET (Web Pages,Web Forms ,MVC )
  9. Chapter 8 工厂方法模式
  10. Fiddler 教程(转)