JavaScript: The Good Parts 学习随笔(一) 由于实习项目需要,我开始了学习javascript的慢慢之途。本博客就记录下我学习javascript的脚印吧~ Douglas Crockford的《JavaScript: The Good Parts》是一本讲述javascript经典书籍,我当然得好好拜读下~ Chapter 1. Good Parts 比较笼统地讲了javascript的缺点和优点。 就是这个...
Doug believes if a feature is sometimes useful and sometimes dangerous and there’s a better option available, always use the better option. This has been his foundation for the good parts of …
[SOUND] I'm out of values and so you'll throw exception instead. Whereas in JavaScript because we're loosely typed you can pass a number or you can pass undefined or you can pass a string, or you can pass an object, you can return anything that you need to. And so these things ...
读《JavaScript: The Good Parts》 有感 提炼出一门语言或技术的 Good Parts, 使用该子集去构造健壮稳固的应用。 我们总是倾向于去学习和使用所有的语言特性,好像凡是新的,凡是提供了的, 就有必要去使用; 这本书告诉我们, 要有选择性地学习和使用。 不是所有的语言特性都需要学习和使用。 学习和使用那些设计不...
【JavaScript】The Good Parts 语法 /*形式的注释因为正则表达式中可能会出现这些字符,所以建议都使用//来进行注释 数字在JS内部统一表示为64位的浮点数,所以1和1.0的值是相同的 NaN不等于任何值,包括它自己 所有字符都是16位的,没有字符类型,可以通过包含一个字符的字符串表示...
读《JavaScript: The Good Parts》 有感 提炼出一门语言或技术的 Good Parts, 使用该子集去构造健壮稳固的应用。 提炼出一门语言或技术的 Good Parts, 使用该子集去构造健壮稳固的应用。 我们总是倾向于去学习和使用所有的语言特性,好像凡是新的,凡是提供了的, 就有必要去使用; 这本书告诉我们, 要有选择性地...
如代码块 代码如下: if (true) { int i = 100; } print(i); //错误,变量i没有声明 如上面例子所示,代码块外的函数是无法访问i变量的。 但在javaScript里,情况则完全不同。 代码如下: if (true) { var i = 100; } alert(i); //弹出框并显示100 很多现代语言都
最近在看JavaScript: The Good Parts,目前为止看的轻松愉快,内容讲的很好。但是到了 Inheritance 一章 Parts 这一节的时候,完全傻眼了,根本不知道它在讲什么东西,求给点提示或者例子,以下是章节内容 PartsWe can compose objects out of sets of parts. For example, we can make a functionthat can add simple...
gramming language. In JavaScript: The Good Parts, Crockford finally digs through the steaming pile of good intentions and blunders to give you a detailed look at all the genuinely elegant parts of JavaScript, including: Syntax Objects Functions Inheritance Arrays Regular expressions Methods Style ...