🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)
🪟 Windows TippsThe Gemini desktop app is now available for Windows(11.09.2026 um 17:06 Uhr)
🪟 Windows TippsHeader and Footer not showing in Excel(14.09.2026 um 22:43 Uhr)
🕵️ SicherheitslückenBurn Out, Or Fade Away(14.09.2026 um 14:25 Uhr)
🪟 Windows TippsKB5129194 Windows 11 26H1 Out of Band Update - Deskmodder.de(14.09.2026 um 19:25 Uhr)

🔧 Programmierung 🕛 vor 3 Monaten 6 Min Lesezeit
0

Operators in JavaScript

↗ Quelle (dev.to)
🗣️ Stimme:

  • JavaScript operators are symbols or keywords used to perform operations on values and variables.

  • They are the building blocks of JavaScript expressions and can manipulate data in various ways.



1. Arithmetic Operator




  • Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.





+= operator



The following example uses the += operator to add one to variable x:




CODE
let x = 10;
x += 1;
console.log(x); // 11






-= operator



The following example uses the -= operator to minus one from the variable x:




CODE
let x = 10;
x -= 1;
console.log(x); // 9






(*=) operator



The following example uses the *= operator to multiply 10 with the variable x:




CODE
let x = 10;
x *= 10;
console.log(x); // 100






/= operator



The following example uses the /= operator to divide x by 2 and assign the result back to x:




CODE
let x = 10;
x /= 2;
console.log(x); // 5






%= operator



The following example uses the %= operator to get the remainder of x is divided by 2 and assigns the remainder back to x:




CODE
let x = 5;
x = x % 2;

console.log(x); // 1







Chaining JavaScript assignment operator



If you want to assign a single value to multiple variables, you can chain the assignment operators. For example:




CODE
let a = 10, b = 20, c = 30;
a = b = c; // all variables are 30






In this example, JavaScript evaluates from right to left. Therefore, it does the following:




CODE
let a = 10, b = 20, c = 30;

b = c; // b is 30
a = b; // a is also 30






3. Comparison / Relational operators



Comparison operators compare two values and return a boolean (true or false). They are useful for making decisions in conditional statements.





See the following example:




CODE
console.log("10" == 10); // true
console.log("10" === 10); // false






In the first comparison, since we use the equality operator, JavaScript converts the string into a number and performs the comparison.



However, in the second comparison, we use the strict equal operator (===), JavaScript doesn’t convert the string before comparison, therefore the result is false.



Vollständiger Original-Bericht
Ausführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.
↗ Original-Artikel auf dev.to lesen
Wie bewertest du diesen Beitrag?
1 Klick Feedback
Teilen mit Netzwerk & Team:

Community-Analysen & Experten-Meinungen 0

Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.
Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf Eigene Analyse verfassen“!
Community Pulse: Relevanz-Einschätzung
1 Klick Experten-Votum
🔴 Akute Relevanz 0%
🟡 In Evaluierung 0%
🟢 Keine Auswirkung 0%
Spannende Innovation 0%
Verwandte Story-Cluster & Quellen (Vektor-KI)
Port 8095 Engine
1 Quelle
The Gemini desktop app is now available for Windows
1 Quelle
Header and Footer not showing in Excel
1 Quelle
Burn Out, Or Fade Away
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Operators in JavaScript

Thematisch verwandte Begriffe: Operators, JavaScript · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...