摘要:
1传统模式——原型链 Father.prototype.name="deng" function Father(){ } var father=new Father() var son=new Father() father.name //deng son.name //deng过多的继承了没用的属 阅读全文
posted @ 2020-04-22 10:02
菜鸟程序员的总结
阅读(373)
评论(0)
推荐(0)
摘要:
每个函数都包含两个非继承而来的方法:apply()和call()。; call与apply都属于Function.prototype的一个方法,所以每个function实例都有call、apply属性; 作用:改变this指向区别:传参不同 call()参数 第一个参数是this值没有变化,其余参数 阅读全文
posted @ 2020-04-22 09:31
菜鸟程序员的总结
阅读(763)
评论(0)
推荐(0)
摘要:
Math.ceil(5.1) //向上取整 6 Math.floor(5.1) //向下取整 5 Math.round(5.5) // 四舍五入结果为6 Math.round(5.4) //结果为5生成10个1-100之间的随机数for(var i=0;i<10;i++){ var num=Math 阅读全文
posted @ 2020-04-22 09:10
菜鸟程序员的总结
阅读(530)
评论(0)
推荐(0)

浙公网安备 33010602011771号