(1)、在html元素事件属性中使用,如:
(2)、构造函数function Animal(name, color) {
this.name = name;
this.color = color;
}
(3)、input点击,获取值
博客介绍了this的三个典型应用。一是在html元素事件属性中使用;二是通过示例展示了在构造函数中使用this定义对象属性;三是利用Math.max的apply和call方法结合this求数组最大值,如对[5, 458, 120, -215]求最大值。
(1)、在html元素事件属性中使用,如:
(2)、构造函数function Animal(name, color) {
this.name = name;
this.color = color;
}
(3)、input点击,获取值

被折叠的 条评论
为什么被折叠?