Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
208 views
in Technique[技术] by (71.8m points)

What does this symbol mean in JavaScript?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

See the documentation on MDN about expressions and operators and statements.

Basic keywords and general expressions

this keyword:

var x = function() vs. function x()?—?Function declaration syntax

(function(){})()?—?IIFE (Immediately Invoked Function Expression)

someFunction()()?—?Functions which return other functions

=>?—?Equal sign, greater than: arrow function expression syntax

|>?—?Pipe, greater than: Pipeline operator

function*, yield, yield*?—?Star after function or yield: generator functions

[], Array()?—?Square brackets: array notation

If the square brackets appear on the left side of an assignment ([a] = ...), or inside a function's parameters, it's a destructuring assignment.

{key: value}?—?Curly brackets: object literal syntax (not to be confused with blocks)

If the curly brackets appear on the left side of an assignment ({ a } = ...) or inside a function's parameters, it's a destructuring assignment.

`${}`?—?Backticks, dollar sign with curly brackets: template literals

//?—?Slashes: regular expression literals

$?—?Dollar sign in regex replace patterns: $$, $&, $`, $', $n

()?—?Parentheses: grouping operator


Property-related expressions

obj.prop, obj[prop], obj["prop"]?—?Square brackets or dot: property accessors

?., ?.[], ?.()?—?Question mark, dot: optional chaining operator

::?—?Double colon: bind operator

new operator

...iter?—?Three dots: spread syntax; rest parameters


Increment and decrement

++, --?—?Double plus or minus: pre- / post-increment / -decrement operators


Unary and binary (arithmetic, logical, bitwise) operators

delete operator

void operator

+, -?—?Plus and minus: addition or concatenation, and subtraction operators; unary sign operators

|, &, ^, ~?—?Single pipe, ampersand, circumflex, tilde: bitwise OR, AND, XOR, & NOT operators


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...