这个符号在JavaScript中意味着什么? [英] What does this symbol mean in JavaScript?

查看:106
本文介绍了这个符号在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.

请帮助。编辑并添加指向其他运算符/语法参考的链接,或者如果您无法找到特定语法的好问题/答案,请添加此问题的答案并将其链接

推荐答案

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

  • 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 (立即调用函数表达式)

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆