While digging through JavaScript's data types, I learnt that:
Strings cannot be divided, multiplied, or subtracted, but the + operator can be used on them. However, there are no such restrictions for numbers.
This is a bit self-explanatory. But, I'm still not clear with few questions like:
- How does JavaScript implement the arithmetic operations on strings in JavaScript?
- How is it different for different data types?
- Or is it true, that arithmetic operations are allowed/meant only and only for numbers. For all other data types, it's just another way of representing other operations (like string/array concatenation)?