How to do arithmetic calculations with objects in JavaScript?
Originally posted here!
To do arithmetic calculations such as addition, subtraction, multiplication, division, etc you need to overwrite the default valueOf() method in the object.
Consider 2 objects John and Lily with name and salary properties def...
melvingeorge-me.hashnode.dev3 min read