- 博客(4)
- 收藏
- 关注
原创 js之constructor属性/instanceof运算符/原型的理解
JS: 一.constructor属性 1.prototype对象有一个constructor属性,默认是指向prototype对象所在的构造函数。 例: function P(){ } P.prototype.constructor === P;//true 2.由于constructor属性定义在prototype对象上面,代表其可以被所有实例对象
2017-10-26 17:01:07
441
转载 JS中call、apply、bind大概区别
为什么需要这些?主要是因为this,来看看this干的好事。box.onclick = function(){ function fn(){ alert(this); } fn();};我们原本以为这里面的this指向的是box,然而却是Window。一般我们这样解决:box.onclick = function(){ var _this = this; functio
2016-12-15 14:53:33
7546
转载 JS中call的用法
js中call的用法: call 方法 : 调用一个对象的一个方法,以另一个对象替换当前对象。 call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 参数 thisObj 可选项。将被用作当前对象的对象。 arg1, arg2, , argN 可选项。将被传递方法参数序列。 说明 :call 方法可以用来代替另一个对象调用另一个对象的方法。
2016-11-24 17:33:04
560
原创 BlendFunc()两个参数详解
//创建一个精灵var layer_1= new cc.LayerColor(cc.color(255,0,0,255),size.width,size.height);var layer_2= new cc.LayerColor(cc.color(0,255,0,255),200,200);this.addChild(layer_1);this.addChild(layer_
2016-08-25 10:15:27
956
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人