Use Compound Multiply Operator in JavaScript

Description

The following code shows how to use Compound Multiply Operator.

Example


<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
var x = 6;<!--from  w ww  . jav  a2  s .  c  o  m-->
document.writeln(x *= 2);
</script>
</body>
</html>

Click to view the demo

The code above generates the following result.

Use Compound Multiply Operator in JavaScript
Home »
  Javascript Tutorial »
    Operator »
      Arithmetic
Javascript Tutorial Arithmetic
Demonstrate Assignment by Value Versus by R...
Find out the effect of pre and post decreme...
Use Arithmetic Operators (+) to Add string ...
Use Arithmetic Operators (+) to add two num...
Use Arithmetic Operators (+) to add two str...
Use Compound Multiply Operator in JavaScrip...
Use Compound Plus Operator in JavaScript
Use Compound Subtraction Operator in JavaSc...
Use Division Assignment operator (/=) in Ja...
Use Division (/) operator between string an...
Use Division (/) operator in JavaScript
Use Division (/) operator with float number...
Use Modulus Assignment operator (%=) in Jav...
Use Modulus (%) operator in JavaScript
Use Multiplication Assignment operator (*=)...
Use Multiplication (*) operator between str...
Use Multiplication (*) operator in JavaScri...
Use Multiply Divide Operator in JavaScript
Use Operator order in parentheses in JavaSc...
Use Postfix operator with another plus oper...
Use Pre-Decrement Operator in JavaScript
Use Pre-Decrement Operator with other opera...
Use Pre-Increment Operator in JavaScript
Use Subtraction (-) Operator between string...
Use Subtraction (-) Operator in JavaScript
Use the Addition Operator to Perform String...