filmov
tv
Multiplication (*) and Exponential (**) Operator | ES7 2016 | Javascript | React Native

Показать описание
ES7 2016
#india
#javascript
The difference between * and ** : -
In JavaScript, `*` and `**` are operators used for multiplication and exponentiation, respectively.
1. **Multiplication (*):**
The * operator is used for multiplication. It can be used to multiply two numbers or variables containing numeric values.
javascript
let result = 5 * 3; // result will be 15
In this example, the * operator multiplies the numbers 5 and 3.
2. **Exponentiation (**):**
The ** operator is the exponentiation operator. It raises the left operand to the power of the right operand.
javascript
let result = 2 ** 3; // result will be 8
In this example, 2 ** 3 means 2 raised to the power of 3, which equals 8.
javascript
However, the ** operator provides a more concise and readable way to express exponentiation.
#india
#javascript
The difference between * and ** : -
In JavaScript, `*` and `**` are operators used for multiplication and exponentiation, respectively.
1. **Multiplication (*):**
The * operator is used for multiplication. It can be used to multiply two numbers or variables containing numeric values.
javascript
let result = 5 * 3; // result will be 15
In this example, the * operator multiplies the numbers 5 and 3.
2. **Exponentiation (**):**
The ** operator is the exponentiation operator. It raises the left operand to the power of the right operand.
javascript
let result = 2 ** 3; // result will be 8
In this example, 2 ** 3 means 2 raised to the power of 3, which equals 8.
javascript
However, the ** operator provides a more concise and readable way to express exponentiation.