JavaScript Good Parts学习笔记-第二章 语法。
来源:互联网 发布:人工智能机器人的英文 编辑:程序博客网 时间:2024/04/29 21:13
1 保留字一览
abstract
boolean break byte
case catch char class const continue
debugger default delete do double
else enum export extends
false final finally float for function
goto
if implements import in instanceof int interface
long
native new null
package private protected public
return
short static super switch synchronized
this throw throws transient true try typeof
var volatile void
while with
2
字符串可以用单引号,也可以用双引号。所有的字符都是16位的。
3
The switch, while, for, and do statements are allowed to have an optional label prefix
that interacts with the break statement.
JavaScript的代码块不像其他语言一样,创建新的作用域。 因此变量应该定义在函数的头部。
4
Here are the falsy values:
• false
• null
• undefined
• The empty string ''
• The number 0
• The number NaN
All other values are truthy, including true, the string 'false', and all objects.
5???原型链???(prototype chain)
The other form (called for in) enumerates the property names (or keys) of an object.
On each iteration, another property name string from the object is assigned to the
variable.
It is usually necessary to test object.hasOwnProperty(variable) to determine whether
the property name is truly a member of the object or was found instead on the prototype
chain.
for (myvar in obj) {
if (obj.hasOwnProperty(myvar)) {
...
}
}
6
不允许在return关键字和表达式之间换行。
不允许在break关键字和表达式之间换行。
7
The values produced by typeof are 'number', 'string', 'boolean', 'undefined',
'function', and 'object'. If the operand is an array or null, then the result is
'object', which is wrong.
- JavaScript Good Parts学习笔记-第二章 语法。
- JavaScript Good Parts学习笔记-第三章 对象
- JavaScript:The Good Parts学习笔记1
- JavaScript: The Good Parts
- JavaScript the Good Parts 读书笔记
- 读书笔记 JavaScript:The Good Parts
- 《JavaScript 语言精粹》 学习笔记 —— 第二章 语法
- javascript权威指南学习笔记(第二章语法结构)
- JavaScript The Good Parts 代码错误
- 读 《JavaScript: The Good Parts》 有感
- javascript the good parts Chapter 4 Functions
- 烂笔头:Javascript The Good Parts
- JavaScript学习笔记-第二章
- OReilly JavaScript The Good Parts 关于变量的使用
- OReilly JavaScript The Good Parts 关于变量Property的访问
- OReilly JavaScript The Good Parts 关于Object.prototype和delete
- 《JavaScript:The Good Parts(影印版)》克罗克福特
- JavaScript : the good parts(语言精髓读书笔记)
- Codeforces Round #268 (Div. 2) 题解
- LoadRunner结果分析
- play教程 第三课:初识play运行机制
- Java继承的内存分配
- 零基础读懂视频播放器控制原理——ffplay播放器源代码分析(二)
- JavaScript Good Parts学习笔记-第二章 语法。
- 又一本《增强现实技术导论》
- Unity框架——状态机
- 生产成本和销售成本的区别
- 来杭州一周年
- Android Glide图片框架使用
- 查看函数库.a函数符号信息
- spring4.1+shiro1.2.3+quartz2.2.1
- 《计算机视觉中的数学方法》