JavaScript Standard Reference Tutorial (Alpha) Notes
http://javascript.ruanyifeng.com/#introduction
2.1.4 N--: Use n again to execute n=n-1;--N: Execute n=n-1 before using n;
The 2.1.5 chunk ({}) var
does not constitute a separate scope for the command, and does not differ from the case where chunks are not used.
2.1.6.3 If there is no break statement inside the case code block in the switch structure, it will then proceed to the next application.
It is important to note that the switch
expression after the statement, compared to the expressions case
following the statement, compares the running result with the strict equality operator ( ===
)rather than the equality operator ( ==
), which means that no type conversion occurs when compared.
2.1.6.4 expression must return a value-(https://www.zhihu.com/question/39420977/answer/81250170)
The 2.1.7.4 break
statement is used to jump out of a code block or loop. The continue
statement is used to terminate the loop immediately, returning to the head of the loop structure and starting the next round of loops.
If there are multiple loops, break
statements and continue
statements without parameters are only for the inner loop .
How the break statement and the continue statement take arguments: add a number / tag after break / continue to indicate a few loops / tag loops, Eg:break 2; /* Jump out of 2 cycles */; (http://wanlimm.com/77201406202191.html)
(a link to a statement note: https://www.jianshu.com/p/0ec3434f7781)
The 2.1.7.5 tag is equivalent to a locator, which can be any identifier, usually with break and continue.
Object literals are one of the salient features of javascript: they allow you to create objects directly-no classes are required.
Note: Functions and arrays are objects. For example, they can have attributes:
function foo () {} = 123;
Instanceof is a two-dollar operator (operator) that determines whether its left object is an instance of its right class and returns a Boolean type of data.
Data type
2.2.2 JavaScript has three ways to determine what kind of a value is.
typeof
operator (note null returns object)
instanceof
Operator
Object.prototype.toString
Method
The 2.2.3var statement has no return value. because var a = 1; is a declaration statement, the declaration statement does not return anything, so there is no return value. Then a = 1; is an assignment statement that returns 1.
2.2.4 If JavaScript expects a location to be a Boolean value, the existing value at that location is automatically converted to a Boolean value. The conversion rule is that except for the following six values are converted false
, other values are considered true
.
undefined
null
false
0
NaN
""
or ‘‘
(empty string)
Note that the []
boolean value corresponding to the empty array () and the empty object ( {}
) is true
.
JavaScript standard Reference Tutorial (Alpha) Notes