JavaScript——prototype属性的apply方法和call方法
2016-02-02 18:32
507 查看
function box(num1,num2){ return num1+num2; } function callBox(num1,num2){ // return box.call(this,num1,num2);//和apply的区别在于后面的传参 // return box.apply(this,[num1,num2]); return box.apply(this,arguments); } alert(callBox(10,10));
相关文章推荐
- app crash率的标准
- 最简单的ListView
- android获取音频、视频、图片信息
- 快速搭建APP的服务器
- iOS:详解MJRefresh刷新加载更多数据的第三方库
- 移动端页面制作的注意事项
- 最简单的观察者模式实现
- android APK加固篇-3.使用JNI加载dex和调用方法
- android Graphics( 五):drawText()详解
- android Graphics(四):canvas变换与操作
- android Graphics(三):区域(Range)
- android Graphics(二):路径及文字
- android滑动界面
- android Graphics(一):概述及基本几何图形绘制
- 王学岗ViewPager——仿微信版(一)
- android webview ZoomButtonsController 导致android.view.WindowLeaked 问题彻底解决
- android 教程实例系列
- Android_低功耗
- android上面圆角,下面直角 ImageView
- android 动画原理二