JavaScript Operators
Types of JavaScript Operators
There are different types of JavaScript operators:
- Arithmetic Operators
- Assignment Operators
- Comparison Operators
- String Operators
- Logical Operators
- Bitwise Operators
- Ternary Operators
- Type Operators
Operator Description + Addition - Subtraction * Multiplication ** Exponentiation (ES2016) / Division % Modulus (Division Remainder) ++ Increment -- Decrement
- Example
<!DOCTYPE html><html><body>
<h1>JavaScript Arithmetic</h1><h2>The += Operator</h2>
<p id="demo"></p>
<script>var x = 10;x += 5;document.getElementById("demo").innerHTML = x;</script>
</body></html>
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Arithmetic</h1>
<h2>The += Operator</h2>
<p id="demo"></p>
<script>
var x = 10;
x += 5;
document.getElementById("demo").innerHTML = x;
</script>
</body>
</html>
No comments:
Post a Comment