自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

转载 this的三种情况

如果把一个函数当作一个方法来用,那他就等于他的父级对象无论是全局环境中的函数,还是匿名函数里面的this都是 undefined作为构造器,this等于即将生成的那个对象...

2018-07-01 13:12:42 177

原创 constructor

function User(name, age){  this.name = name;  this.age = age;}User.prototype.greet = function(){  console.log('hi,我是' + this.name + '我现在' + this.age + '岁');}var bb = new User('BB',22);   var bb = new ...

2018-06-29 16:00:28 509

原创 prototype

function User(name, age){  this.name = name;  this.age = age;}User.prototype.greet = function(){  console.log('hi,我是' + this.name + '我现在' + this.age + '岁');}var bb = new User('BB',22);//这里bb已经实例化,User...

2018-06-29 15:50:01 250

原创 function 执行的一些小疑问

function User(name, age){  this.name = 'bb';  this.age = age;}User.prototype.greet = function(){        //prototype在User里面创建了一个名叫 greet 的 function,  console.log('hi,我是' + this.name + '我现在' + this.age ...

2018-06-29 15:28:25 161

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除