Horje
Multiplication Assignment(*=) Operator in JavaScript

Multiplication Assignment Operator(*=) in JavaScript is used to multiply two operands and assign the result to the right operand.

Syntax:

variable1 *= variable2
// variable1 = variable1 * variable2

Example 1: In this example, we multiply two numerical values using the Multiplication Assignment Operator(*=) and assign the result variable in javascript.

Javascript

let number = 5;
number *= 2;
console.log(number);
// Expected output:10

 

Output:

10

Example 2: Here we perform multiplication with a non-Numeric value and it will return NaN using the Multiplication Assignment Operator(*=) in javascript.

Javascript

let number = 10;
number *= "GeeksforGeeks";
  
console.log(number);
// Expected outout: NaN

Output:

NaN

We have a complete list of Javascript Assignment operators, to check those please go through the Javascript Assignment operators. 

Supported browser:

  • Chrome 1
  • Edge 12
  • Firefox 1
  • Safari 1
  • Opera 3


Reffered: https://www.geeksforgeeks.org


JavaScript

Related
How to catch props data on component change in Vue.js ? How to catch props data on component change in Vue.js ?
Visual studio code doesn't give out error if parents function didn't close correctly Visual studio code doesn't give out error if parents function didn't close correctly
JavaScript Promise then() Method JavaScript Promise then() Method
How are characters stored in JavaScript ? How are characters stored in JavaScript ?
How are strings stored in JavaScript ? How are strings stored in JavaScript ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
13