没有合适的资源?快使用搜索试试~ 我知道了~
mastering-javascripts-this
需积分: 0 0 下载量 74 浏览量
2014-08-25
22:52:27
上传
评论
收藏 8.33MB PDF 举报
温馨提示
试读
34页
读者可通过该PDF全面了解javascript的this指针!解决读者对this指向不定的疑惑~
资源详情
资源评论
资源推荐
5 Rules For Mastering JavaScript’s ”this”
A multi-day journey, exploring JavaScript’s most notorious
keyword
Derick Bailey
This book is for sale at http://leanpub.com/mastering-javascripts-this
This version was published on 2014-06-05
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and
many iterations to get reader feedback, pivot until you have the right book and build traction once
you do.
©2014 Muted Solutions, LLC. All Rights Reserved.
Tweet This Book!
Please help Derick Bailey by spreading the word about this book on Twitter!
The suggested hashtag for this book is #MasteringJavaScriptThis.
Find out what other people are saying about the book by clicking on this link to search for this
hashtag on Twitter:
https://twitter.com/search?q=#MasteringJavaScriptThis
Contents
About This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
How This Book Is Laid Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i
Day 0: Preparing For The Journey . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The 5 Rules Of JavaScript’s “this” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
The Real Journey Begins Tomorrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Day 1: Simple Function Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Simple Function Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
The Default Value of “this” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
In Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Day 2: Method Calls On Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
An Object With A Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Dissecting The Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
When A Method Becomes A Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
In Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Day 3: The “new” Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
A Constructor Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
How Does That Work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
In Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Day 4: Using .call And .apply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Functions With Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Similar, But Different . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Override Invocation Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Coming Up Tomorrow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Day 5: Using .bind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Introducing The .bind Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Permanently Override The Context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
A Note On The Availability Of .bind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
剩余33页未读,继续阅读
frankyliew
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Open3D C++ 系列教程源代码(四)动画 Tick事件
- lab7_02.c
- 基于 SpringCloud 和 Vue3 的OA系统
- 软考高级项目管理师-项目采购管理思维导图
- WordsVector (1).ipynb
- yolov7 车牌检测 车牌识别 中文车牌识别 检测 支持双层车牌 支持12种中文车牌
- 20240429_112025.m4a
- "麦嘟学编程"似乎是一个与编程学习相关的品牌或社区名称,它可能是一个在线教育平台、博客、论坛或社交媒体群组等,旨在帮助人们学习编
- OpenCV(Open Source Computer Vision Library)是一个开源的计算机视觉和机器学习软件库,由
- Redis入门基础篇+源码(springboot、maven)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0