variations using the + sign with adding values
I have seen the plus sign used two different ways for adding numbers and have found that when used as in the second example below it can solve the problem of concantenating numbers. I would like to know when it is appropriate to use it as in the second example Say the variables apples, oranges, grapes and mangos each represent a numerical value. I might see these added like this:
(1) var total = apples + oranges + grapes + mangos;
or I might see these added like this:
(2) var total = +apples + +oranges + +grapes + +mangos;
Also, in the second example, is it correct for the first variable, apples, to lead with the + sign, as +applies, or should that line be written like this: var total = apples + +oranges + +grapes + +mangos;
