MDN参考资料运营商
==
, ===
Equality Operators
==
, ===
Equality Operators
- Which equals operator (== vs ===) should be used in JavaScript comparisons?
- How does JS type coercion work?
- In Javascript, <int-value> == "<int-value>" evaluates to true. Why is it so?
- [] == ![] evaluates to true
- Why does "undefined equals false" return false?
- Why does !new Boolean(false) equals false in JavaScript?
- Javascript 0 == '0'. Explain this example
- Why false == "false" is false?
!=
,!==
不等运算符
- != vs. !==
- Javascript operator !==
&&
, ||
,!
逻辑运算符
- Logical operators in JavaScript — how do you use them?
- Logical operator || in javascript, 0 stands for Boolean false?
- What does "var FOO = FOO || {}" (assign a variable or an empty object to that variable) mean in Javascript?, JavaScript OR (||) variable assignment explanation, What does the construct x = x || y mean?
- Javascript AND operator within assignment
- What is "x && foo()"? (also here and here)
- What is the !! (not not) operator in JavaScript?
- What is an exclamation point in JavaScript?
,
逗号运算符
- What does a comma do in JavaScript expressions?
- Comma operator returns first value instead of second in argument list?
- When is the comma operator useful?
?...:
条件(三元)运算符
- Question mark and colon in JavaScript
- Operator precedence with Javascript Ternary operator
- How do you use the ? : (conditional) operator in JavaScript?
|
,&
, ^
,〜
按位OR,AND ,XOR& NOT运营商
- What do these JavaScript bitwise operators do?
- How to: The ~ operator?
- Is there a & logical operator in Javascript
- What does the "|" (single pipe) do in JavaScript?
- What does the operator |= do in JavaScript?
- Javascript, What does the ^ (caret) operator do?
- Using bitwise OR 0 to floor a number, How does x|0 floor the number in JavaScript?
- Why does
~1
equal -2
?
- What does ~~ ("double tilde") do in Javascript?
- How does !!~ (not not tilde/bang bang tilde) alter the result of a 'contains/included' Array method call? (also here and here)
<<
,>>
,>>>
比特移位运营商
- What do these JavaScript bitwise operators do?
- What is the JavaScript >>> operator and how do you use it?
+
, -
运算符
- What does = +_ mean in JavaScript, Single plus operator in javascript
- What's the significant use of unary plus and minus operators?
++
, -
前/后增/减运算符
++
, --
pre/post-increment/decrement operators
-
++someVariable
vs someVariable++
in Javascript
void
operator
void
operator
var x =有趣ction()
vs function x()
函数声明语法
var x = function()
vs function x()
Function Declaration Syntax
- var functionName = function() {} vs function functionName() {}
=>
箭头函数表达式语法
- What's the meaning of "=>" (an arrow formed from equals & greater than) in JavaScript?
(function(){...})()
IIFE (立即调用函数表达式)
- 目的是什么?,如何调用?
- 为什么
(function(){...})();
工作但是 function(){...}();
没有?
-
(功能(){...})();
vs (function(){...}());
- 更短的替代方案:
- What is the purpose?, How is it called?
- Why does
(function(){…})();
work but function(){…}();
doesn't?
-
(function(){…})();
vs (function(){…}());
- shorter alternatives:
-
!function(){…}();
- What does the exclamation mark do before the function?
-
+function(){…}();
- JavaScript plus sign in front of function name
- !function(){ }() vs (function(){ })(),
!
vs leading semicolon
someFunction()()
返回其他函数的函数
- Two sets of parentheses after function call
[]
,数组( )
数组符号
- What’s the difference between "Array()" and "[]" while declaring a JavaScript array?
- What is array literal notation in javascript and when should you use it?
/.../
- 正则表达式文字
/.../
- regular expression literals
- Meaning of javascript text between two slashes
$
在正则表达式替换模式: $$
, $&
, $`
, $'
, $ n
$
in regex replace patterns: $$
, $&
, $`
, $'
, $n
- JavaScript replace() method dollar signs
{key:value}
对象文字语法:
- What do curly braces in JavaScript mean?
- Javascript object literal: what exactly is {a, b, c}?
- What do square brackets around a property name in an object literal mean?
解构:
- of function parameters: Where can I get info on the object parameter syntax for javascript functions?
- of arrays: Multiple assignment in javascript? What does [a,b,c] = [1, 2, 3]; mean?
- of objects/imports: Javascript object bracket notation ({ Navigation } =) on left side of assign
模板文字:
- What does this
`…${…}…`
code from the node docs mean?
function *
, yield
, yield *
生成器功能:
- What is "function*" in JavaScript?
- What's the yield keyword in JavaScript?
- Delegated yield (yield star, yield *) in generator functions
var
,让
, const
声明变量:
- What's the difference between using "let" and "var" to declare a variable in JavaScript?
- Are there constants in JavaScript?
- What is the temporal dead zone?
此
关键字:
- How does the "this" keyword work?
::
绑定运算符:
- JavaScript double colon (bind operator)
new
operator
new
operator
删除
运算符
- What is the purpose of the delete operator in Javascript?
label:
标签
- What does the JavaScript syntax foo: mean?
- What does ':' (colon) do in JavaScript?
+ =
运算符
- How does += (plus equal) work?
... iter
- Spread语法/ Rest参数
...iter
— Spread syntax / Rest parameters
-
(...args) => {}
— What is the meaning of "...args" (three dots) in a function definition?
-
[...iter]
— javascript es6 array feature [...data, 0] "spread operator"
-
{...props}
— Javascript Property with three dots (...)