arithmetic operator in javascript code example
Example 1: modulus js
console.log(10%3);
Example 2: javascript Arithmetic operators
var additionOutput = 2 + 2;
var subtractionOutput = 2 - 2;
var multiplcationOutput = 2 * 2;
var divisionOutput = 2 / 2;
var exponentiation = 2**2;
var modulus = 5 % 2;
var unaryOperator = 1;
++unaryOperator;
Example 3: javascript ... operator
var [head, ...tail] = ["Hello", "I" , "am", "Sarah"];
console.log(head);
console.log(tail);
let a = [2,3,4];
Math.max(a)
Math.max(...a)