没有合适的资源?快使用搜索试试~ 我知道了~
首页Eloquent JavaScript(3rd) 无水印原版pdf
Eloquent JavaScript(3rd) 无水印原版pdf
5星 · 超过95%的资源 需积分: 9 105 下载量 69 浏览量
更新于2023-03-16
评论 2
收藏 2.17MB PDF 举报
Eloquent JavaScript(3rd) 英文无水印原版pdf 第3版 pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书
资源详情
资源评论
资源推荐
Eloquent JavaScript
3rd edition
Marijn Haverbeke
Copyright © 2018 by Marijn Haverbeke
This work is licensed under a Creative Commons attribution-noncommercial
license (http://creativecommons.org/licenses/by-nc/3.0/). All code in the
book may also be considered licensed under an MIT license (http://opensource.
org/licenses/MIT).
The illustrations are contributed by various artists: Cover and chapter illus-
trations by Madalina Tantareanu. Pixel art in Chapters 7 and 16 by Antonio
Perdomo Pastor. Regular expression diagrams in Chapter 9 generated with
regexper.com by Je Avallone. Village photograph in Chapter 11 by Fabrice
Creuzot. Game concept for Chapter 15 by Thomas Palef.
The third edition of Eloquent JavaScript was made possible by 325 nancial
backers.
You can buy a print version of this book, with an extra bonus chapter included,
printed by No Starch Press at https://www.amazon.com/Eloquent-JavaScript-
2nd-Ed-Introduction/dp/1593275846.
i
Contents
Introduction 1
On programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Why language matters . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
What is JavaScript? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Code, and what to do with it . . . . . . . . . . . . . . . . . . . . . . . 7
Overview of this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Typographic conventions . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1 Values, Types, and Operators 10
Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Unary operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Boolean values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Empty values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Automatic type conversion . . . . . . . . . . . . . . . . . . . . . . . . . 18
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2 Program Structure 22
Expressions and statements . . . . . . . . . . . . . . . . . . . . . . . . 22
Bindings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Binding names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
The environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
The console.log function . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Return values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Control ow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Conditional execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
while and do loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Indenting Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
for loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Breaking Out of a Loop . . . . . . . . . . . . . . . . . . . . . . . . . . 33
ii
Updating bindings succinctly . . . . . . . . . . . . . . . . . . . . . . . 34
Dispatching on a value with switch . . . . . . . . . . . . . . . . . . . . 34
Capitalization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3 Functions 39
Dening a function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Bindings and scopes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Functions as values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Declaration notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Arrow functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
The call stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Optional Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Closure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Growing functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Functions and side eects . . . . . . . . . . . . . . . . . . . . . . . . . 54
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
4 Data Structures: Objects and Arrays 57
The weresquirrel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Data sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Mutability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
The lycanthrope’s log . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Computing correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Array loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
The nal analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Further arrayology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Strings and their properties . . . . . . . . . . . . . . . . . . . . . . . . 72
Rest parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
The Math object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Destructuring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
JSON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
iii
剩余447页未读,继续阅读
yinkaisheng-nj
- 粉丝: 763
- 资源: 6953
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- 2023年中国辣条食品行业创新及消费需求洞察报告.pptx
- 2023年半导体行业20强品牌.pptx
- 2023年全球电力行业评论.pptx
- 2023年全球网络安全现状-劳动力资源和网络运营的全球发展新态势.pptx
- 毕业设计-基于单片机的液体密度检测系统设计.doc
- 家用清扫机器人设计.doc
- 基于VB+数据库SQL的教师信息管理系统设计与实现 计算机专业设计范文模板参考资料.pdf
- 官塘驿林场林防火(资源监管)“空天地人”四位一体监测系统方案.doc
- 基于专利语义表征的技术预见方法及其应用.docx
- 浅谈电子商务的现状及发展趋势学习总结.doc
- 基于单片机的智能仓库温湿度控制系统 (2).pdf
- 基于SSM框架知识产权管理系统 (2).pdf
- 9年终工作总结新年计划PPT模板.pptx
- Hytera海能达CH04L01 说明书.pdf
- 数据中心运维操作标准及流程.pdf
- 报告模板 -成本分析与报告培训之三.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论4