随笔分类 -  JS书籍(You Don't know JS)

各类相关书籍
摘要:ES201X是JavaScript的一个版本。 ES2015新的feature let, const Scope, 块作用域 Hoisting Closures DataStructures: Objects and Arrays this let, const, Block Scope 新的声明类 阅读全文
posted @ 2018-12-29 20:22 Mr-chen 阅读(362) 评论(0) 推荐(0)
摘要:Chapter 3: Promises But what if we could uninvert that inversion of control? What if instead of handing the continuation of our program to another par 阅读全文
posted @ 2018-10-11 18:03 Mr-chen 阅读(263) 评论(0) 推荐(0)
摘要:Chapter 1: Asynchrony: Now & Later 在一门语言中,比如JavaScript, 最重要但仍然常常被误解的编程部分是如何在一个完整的时间周期表示和操作程序行为。 这是关于当你的程序正在部分运行,其他部分等待运行。--这之间的gap。 mind the gap!(比如在s 阅读全文
posted @ 2018-10-10 10:26 Mr-chen 阅读(393) 评论(0) 推荐(0)
摘要:qu上章提到过[[prototype]] chain, 本章详细分析 ⚠️所有试图模仿类复制的行为,如上章提到的mixins的变种,完全规避了[[Prototype]] chain机制,本章会谈到这方面 [[Prototype]] 一个特别的内建属性。用于引用到其他对象。当对象创建后,会得到一个这个 阅读全文
posted @ 2018-10-08 09:17 Mr-chen 阅读(226) 评论(0) 推荐(0)
摘要:本章移到“Object oriented programming”和"classes"。 看‘class orientation‘ 的设计模式: instantiation, inheritance, relative 多态性。 会重点讲解oop理论,当讲到Mixins, 我们会最终联系这些思想到真 阅读全文
posted @ 2018-10-07 16:31 Mr-chen 阅读(120) 评论(0) 推荐(0)
摘要:前2章探索了this绑定指向不同的对象需要函数引用的call-site。 但是什么是对象,为什么我们需要指向它们? 本章探索细节。 Syntax the rules that describe how words and phrases are used in a computer language 阅读全文
posted @ 2018-10-05 19:56 Mr-chen 阅读(190) 评论(0) 推荐(0)
摘要:this is a binding made for each function invocation, based entirely on its call-site (how the function is called). this是为函数被引用而创建的绑定!完全地基于函数如何被调用/函数的c 阅读全文
posted @ 2018-10-05 11:46 Mr-chen 阅读(242) 评论(0) 推荐(0)
摘要:Foreword this 关键字和prototypes 他们是用JS编程的基础。没有他们创建复杂的JS程序是不可能的。 我敢说大量的web developers从没有建立过JS Object,仅仅对待这门语言作为一个事件绑定胶水,在按钮和Ajax请求之间。 我也曾是他们的一员,但是当我了解到如何掌 阅读全文
posted @ 2018-10-04 22:10 Mr-chen 阅读(213) 评论(0) 推荐(0)
摘要:JavaScript只有Lexical Scope 模式 Lexical Scope就是在写代码的时候,定义函数的时候创建的作用域! 而动态作用域是在runtime时,函数被调用的地方的作用域! 实际上 dynamic Scope是 this关键字的近亲。这会在this & Object Proto 阅读全文
posted @ 2018-10-04 18:07 Mr-chen 阅读(374) 评论(0) 推荐(0)
摘要:Chapter 5: Scope Closure 我们到达这里时,已经对作用域如何工作有了非常健康稳固的理解。 下面,我们转移注意力到一个及其重要,但长期难以理解,几乎是神话中的部分语言:Closure! Enlightenment💡启发 那些有使用JS的经验,但没有完全抓住closures的概念 阅读全文
posted @ 2018-10-03 13:58 Mr-chen 阅读(270) 评论(0) 推荐(0)
摘要:Chapter4: Hoisting 变量附加到哪个层次的scope,由它们在哪里和如何声明(let, var)来决定。 Function scope/Block scope都有相同的法则:任何变量在一个scope内声明,则这个变量附加到这个作用域上。 但有一个细节问题:当声明declaration 阅读全文
posted @ 2018-10-03 13:50 Mr-chen 阅读(140) 评论(0) 推荐(0)
摘要:第二章,作用域由一系列的bubbles组成。每一个都代表了一个container或bucket,装着被声明的identifiers(variables, functions)。这些bubbles相互嵌套。这种嵌套是在开发阶段写完的。 什么制造了一个新的bubble? 只是函数吗?其他的JS结构可以创 阅读全文
posted @ 2018-10-02 21:49 Mr-chen 阅读(203) 评论(0) 推荐(0)
摘要:2种主要的models for how scope work. 最普遍的是Lexical Scope. 另一种 Dynamic Scope。(在Appendix a中介绍。和Lexical Scope 进行对比) Lex-time lexical scope is scope that is def 阅读全文
posted @ 2018-10-02 18:21 Mr-chen 阅读(300) 评论(0) 推荐(0)
摘要:Content Appendix: Chapter1: What is Scope? In fact, the ability to store values and pull values out of variables is what gives a program state. 背后的问题: 阅读全文
posted @ 2018-10-02 15:30 Mr-chen 阅读(240) 评论(0) 推荐(0)
摘要:https://github.com/getify/You-Dont-Know-JS 有6个系列。git在线免费。 第一本, up and going (点击链接) Mission: 作者建议在开始学习时,learn 'just enough' to get by。无需了解语言行为的how and 阅读全文
posted @ 2018-09-25 21:17 Mr-chen 阅读(508) 评论(0) 推荐(0)