You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// - When we work with math expression in JavaScript it's evaluate multiplication and division first after that it will consider addition and subtraction.
let variable = (4 / 2) * 2 + 1;
console.log(myVariable1);
// How
// - To calculate math expression manually in JavaScript we use small bracket (). We surround which expression we need to evaluate first.
let variable1 = (4 / 2) * (2 + 1);
console.log(myVariable2);
// Note
// Adding string with number in JavaScript treat number as a string.
let variable2 = "str" + 1 + 2;
console.log(variable2);
// JavaScript evaluate code from left to right so it will do the arithmetic operation first than treat the answer as a string.