2022年7月3日

call/apply 引用其他人的属性(改变this指向),传参列表不同

摘要: //call/apply(作用相同但写法不同) :引用其他人的属性(改变this指向),传参列表不同 //一call :把实参按照形参个数传进去 // function Test(name,age) { // this.name = name; // this.age = age; // } // 阅读全文

posted @ 2022-07-03 11:21 爱前端的小魏 阅读(17) 评论(0) 推荐(0) 编辑

Math.ceil 、Math.floor 、 Math.random

摘要: 向上取整 Math.ceil //向下取整 Math.floor //随机数(0-1) Math.random // var num = 0.14; // var num1 = 100; // document.write(Math.ceil(num * num1)+ " ");//15 // do 阅读全文

posted @ 2022-07-03 11:20 爱前端的小魏 阅读(32) 评论(0) 推荐(0) 编辑

导航