- 博客(3)
- 资源 (4)
- 收藏
- 关注
原创 Math.max Math.min
Math.max返回数组最大值 var result=Math.max(1,2,3,4,5) console.log(result)=========>5 Math.min返回数组最小值 var result=Math.min(1,2,3,4,5) console.log(result)=========>1
2022-04-12 15:16:57 66
原创 call和apply
call(对象,参数,参数) 可以改变this的指向 第一个参数:更改this指定到的对象 后面的参数就是当前方法需要的参数 function Student(name){ this.name=name this.showInfo=function(){ console.log(this.name) } this.abc=function(a,b,c){ ...
2022-04-12 15:10:40 146
原创 继承的三种方式
1.原型链继承 思路:将父级的对象 赋值给子级的原型 缺点:无法对属性进行初始化 ,所有的属性都是固定 老师与学生: function person(name,age,done){ // this.name=name // this.age=age // this.done=done // } // function student(name,age,done){ // } // student.prototype=
2022-04-12 14:28:55 83
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人