Operators
JavaScript provides most of the common operators that can be found in other programming languages. Due to the JavaScript's way of handling strings, some of these operators are a bit easier to use than in other languages.
Arithmetic
Just like other programming languages, JavaScript allows many arithmetic operations. These operations include the common addition and subtraction that all programmers use, as well as the less common modulus and incremental.
Note
All the common arithmetic operators will attempt to convert strings to numbers when applicable. If a string cannot be converted to a number, NaN (Not A Number) will be returned.
Those who have programmed in other languages will find that JavaScript is very robust in its support ...
Get Pure JavaScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.