这个符号在JavaScript中意味着什么? [英] What does this symbol mean in JavaScript?
问题描述
这是一系列关于JavaScript语法的问题。这也是社区Wiki,所以每个人都被邀请参与维护此列表。
This is a collection of questions that come up every now and then about syntax in JavaScript. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.
Stack Overflow不允许搜索特定字符。因此,在搜索运算符和其他语法标记时,很难找到许多关于运算符和其他语法标记的问题。这也使得关闭重复更加困难。下面的列表是为了解决这个问题。
Stack Overflow does not allow searching for particular characters. As a consequence, many questions about operators and other syntax tokens are not found easily when searching for them. This also makes closing duplicates more difficult. The list below is to help with this issue.
主要思想是在Stack Overflow上提供现有问题的链接,因此我们更容易引用它们,而不是复制来自ECMAScript Spec的内容。
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from the ECMAScript Spec.
此外,这是 PHP 符号引用。我们需要一个JS。
Additionally, this is a blatant copy of the PHP symbol reference. We needed a JS one.
请帮助。编辑并添加指向其他运算符/语法参考的链接,或者如果您无法找到特定语法的好问题/答案,请添加此问题的答案并将其链接
推荐答案
==
, ===
Equality Operators
==
, ===
Equality Operators
- 哪些等于运算符(== vs ===)应该用于JavaScript比较?
- JS类型强制如何工作?
- 在Javascript中,< int-value> =="< int-value>"评估为真。为什么会这样?
- [] ==![]评估为真
- 为什么会这样做? ; undefined等于false返回false?
- 为什么!新的布尔值(false)在JavaScript中等于false?
- Javascript 0 =='0'。解释此示例
- 为什么错误== "假QUOT;是假的?
- 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 !==
&&
, ||
,!
逻辑运算符
- JavaScript中的逻辑运算符 - 你如何使用它们?
- 逻辑运算符||在javascript中,0代表布尔值假?
- 什么做var FOO = FOO || {}" (为该变量分配变量或空对象)是指Javascript?, JavaScript OR(||)变量赋值说明,构造x = x ||是什么是什么意思?
- 任务中的Javascript AND运营商
- 什么是x&& foo()"?(也此处和这里)
- 什么是!! (不是)JavaScript中的运算符?
- JavaScript中的感叹号是什么?
- 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?
?...:
条件(三元)运算符
- JavaScript中的问号和冒号
- < a href =https://stackoverflow.com/q/1788917/1048572>运算符优先级使用Javascript Ternary运算符
- 你如何使用? :JavaScript中的(条件)运算符?
- 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运营商
- 这些JavaScript按位运算符做什么?
- 如何to:〜运营商?
- 是否有& Javascript中的逻辑运算符
- |是什么? (单管道)用JavaScript做什么?
- 运营商| =做什么在JavaScript中?
- Javascript,^(插入符号)操作符有什么作用?
- 使用按位或0到底层数字, x | 0楼的JavaScript数字?
- 为什么
〜1
等于-2
? - 在Javascript中做什么~~(双倍波浪)?
- 怎么做!!(不是没有波浪形/波浪形波浪)改变'包含/包含'数组方法调用的结果?(als o 此处和此处)
- 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
vssomeVariable++
in Javascript
void
operator
void
operator
- What does `void 0` mean?
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(){...}());
- 更短的替代方案:
-
!function(){...}();
- 感叹号是什么在功能之前做什么? -
+ function(){...} ();
- 功能名称前面的JavaScript加号 - !function(){}()vs(function(){})(),
!
vs领先的分号
- What is the purpose?, How is it called?
- Why does
(function(){…})();
work butfunction(){…}();
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()()
返回其他函数的函数- < a href =https://stackoverflow.com/questions/18234491/two-sets-of-parentheses-after-function-call>函数调用后的两组括号
- 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?
解构:
- 的函数参数:< a href =https://stackoverflow.com/q/10804982/1048572>我在哪里可以获得有关javascript函数的对象参数语法的信息?
- 数组: javascript中的多项作业? [a,b,c] = [1,2,3]是什么;对象/导入是什么意思?
- : Javascript对象括号表示法({Navigation} =)在分配的左侧
- 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
声明变量:- < a href =https://stackoverflow.com/q/762011/1529630>使用let和let之间的区别是什么?和var在JavaScript中声明变量?
- JavaScript中是否有常量?
- 什么是暂时死区?
- 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
operatornew
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)=> {}
- args是什么意思? (函数定义中的三个点)? -
[... iter]
- javascript es6数组功能[...数据,0]&传播运营商 -
{... props}
- 带三个点的Javascript属性(...)
(...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 (...)
这篇关于这个符号在JavaScript中意味着什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
-