javascript bind
来源:互联网 发布:钱龙金典版软件 编辑:程序博客网 时间:2024/06/06 03:13
最近在代码中经常看到bind关键词,之前没用过啊,这里记录下。从微软复制过来的例子:
// Define the original function.var checkNumericRange = function (value) { if (typeof value !== 'number') return false; else return value >= this.minimum && value <= this.maximum;}// The range object will become the this value in the callback function.var range = { minimum: 10, maximum: 20 };// Bind the checkNumericRange function.var boundCheckNumericRange = checkNumericRange.bind(range);// Use the new function to check whether 12 is in the numeric range.var result = boundCheckNumericRange (12);document.write(result);// Output: true
http://msdn.microsoft.com/zh-cn/library/ff841995
bind还有其他用法,感觉使用bind代码会失去可读性啊?
1 0
- javascript bind
- Javascript bind 与 jQuery bind
- javascript之bind
- 【JavaScript】call, apply, bind
- JavaScript bind方法
- javascript中的bind()
- JavaScript bind()方法介绍
- Javascript-bind绑定函数
- Javascript之bind
- 理解Javascript Bind()方法
- Javascript中bind实现
- Javascript通过bind()掌控this
- javascript的bind()函数使用
- Javascript通过bind()掌控this
- javascript Function.propertype.bind 解析
- javascript之bind使用介绍
- javascript中的call()和bind()
- javascript 中的call、apply、bind
- 关于SharePoint TimerJob安装后无部署
- LeetCode - Sort List
- 在ubuntu12.04+hadoop2.3.0集群上运行WordCount出错
- MyBatis多参数传递之注解方式示例
- 编程精华资源大汇总
- javascript bind
- Allegro 执行 Display->Measure 命令时显示两种单位制
- 该怎么恢复断电丢失的文件呢
- javaScript 对象属性和函数的加入方法
- EOJ 2067 Solution Report - Building Roads
- JQuery 选择器
- xstream别名alias
- WinCE的C#程序中,使程序界面最小化,最大化,隐藏等的操作
- iOS archive(归档)的总结