• Všechny velikosti
  • Velké
  • Malé
  • Barevné
  • Černobílé
  • Jen barevné
A new category of operators in JavaScript ✨
There has been 2 kinds of Assignment Operators in JavaScript (besides the actual Assignment Operator =) - Arithmetic Assignment Operators, like +=, *=, -=. - Bitwise Operators <<=, >>>=, ^=, &=.
But there's a new kind of operators ready for you to use today in JavaScript, called: Logical Assignment Operators.
Today I'm going to show you Logical Nullish Assignment.
The Logical Nullish Assignment (x ??= y) operator only assigns if x is nullish (null or undefined).
The Nullish Coalescing Operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule:
(some expression that is neither null nor undefined) ?? expr is short-circuit evaluated to the left-hand side expression if the left-hand side proves to be neither null nor undefined.
Short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place).
Logical nullish assignment short-circuits as well meaning that x ??= y is equivalent to:
x ?? (x = y);
And not equivalent to the following which would always perform an assignment:
x = x ?? y;
I explained this operator in more detail, on YouTube and Medium, wanna watch the video?⁣⁣⁣⁣ - Link in the bio 🔥⁣⁣⁣⁣ ⁣ Have any questions about web development?⁣⁣ - Ask away 💌⁣⁣ ⁣⁣ Wanna build a web app?⁣⁣ - Get in touch 👨‍💻⁣⁣ ⁣⁣ Want to support me in my journey?⁣⁣ - Leave a comment with good vibes.⁣⁣ - Tag a friend that might find my page @codingedgar interesting.⁣⁣ - Turn notifications to know when I publish new stuff.⁣⁣ - Destroy the like button. (both here and in YouTube, of course)⁣
#codingpics #learnhowtocode #webdevelop #softwarearchitect #softwaredev #opensourcesoftware #webdeveloperslife #programmingstudents #computerprogramming #fullstacklife #computersciencemajor #webdevelopmentagency #spain #germany #russia #finland #webdeisgn #softwareengineers #webdeveloperlife #poland #programmer #sweden #webdesignagency #learnprogramming #france #ukraine #learntocode #programmers #norway #javascriptbottcamp
A new category of operators in JavaScript ✨ There has been 2 kinds of Assignment Operators in JavaScript (besides the actual Assignment Operator =) - Arithmetic Assignment Operators, like +=, *=, -=. - Bitwise Operators <<=, >>>=, ^=, &=. But there's a new kind of operators ready for you to use today in JavaScript, called: Logical Assignment Operators. Today I'm going to show you Logical Nullish Assignment. The Logical Nullish Assignment (x ??= y) operator only assigns if x is nullish (null or undefined). The Nullish Coalescing Operator is evaluated left to right, it is tested for possible short-circuit evaluation using the following rule: (some expression that is neither null nor undefined) ?? expr is short-circuit evaluated to the left-hand side expression if the left-hand side proves to be neither null nor undefined. Short circuit means that the expr part above is not evaluated, hence any side effects of doing so do not take effect (e.g., if expr is a function call, the calling never takes place). Logical nullish assignment short-circuits as well meaning that x ??= y is equivalent to: x ?? (x = y); And not equivalent to the following which would always perform an assignment: x = x ?? y; I explained this operator in more detail, on YouTube and Medium, wanna watch the video?⁣⁣⁣⁣ - Link in the bio 🔥⁣⁣⁣⁣ ⁣ Have any questions about web development?⁣⁣ - Ask away 💌⁣⁣ ⁣⁣ Wanna build a web app?⁣⁣ - Get in touch 👨‍💻⁣⁣ ⁣⁣ Want to support me in my journey?⁣⁣ - Leave a comment with good vibes.⁣⁣ - Tag a friend that might find my page @codingedgar interesting.⁣⁣ - Turn notifications to know when I publish new stuff.⁣⁣ - Destroy the like button. (both here and in YouTube, of course)⁣ #codingpics #learnhowtocode #webdevelop #softwarearchitect #softwaredev #opensourcesoftware #webdeveloperslife #programmingstudents #computerprogramming #fullstacklife #computersciencemajor #webdevelopmentagency #spain #germany #russia #finland #webdeisgn #softwareengineers #webdeveloperlife #poland #programmer #sweden #webdesignagency #learnprogramming #france #ukraine #learntocode #programmers #norway #javascriptbottcamp
Při pokusu o sdílení polohy došlo k chybě
Více informací
odkazuje na služby nejen od Seznam.cz.

© 1996–2024 Seznam.cz, a.s.

3279/6027,3218/5931