Simple Math calculations
Addition of two integers
5+5; // 10
Multiplication of two integers
5*5; // 25
If we add a number to a string, the number will be converted into a string and the result will be a concatenation of the two strings
5+'12'; // 512
String multiplied by an integer
5*'5'; // 25
Multiplication of a string (but not numeric string) and a number
5*'t'; // NaN
The first operation of the expression is addition and then concatenation
5+5+'2'; // 102
by Valeri Tandilashvili
4 years ago
JavaScript
1
Pro tip: use ```triple backticks around text``` to write in code fences