tags:

views:

232

answers:

2

Title is most of the question, what allows this to be valid code? Is there any benefit or trick that would allow me to utilize this?

+2  A: 

The extra pluses are being treated as positive indicators. As in +1.

What was the rational on adding positive indicators?? Anyone have any insight to this?
Dested
so it's 6 + really really very positive 6?
Mike Two
@Dested: Rationale? Rationale? The inmates run that asylum, my friend. If anything, it would be symmetry.
@Mike Two: Yes. As positive as you can get without adding another plus sign.
can you do the same thing with minus ( 6 - - - - - - 6) ?
Thilo
@Thilo: Apparently... but with a less stable effect, obviously.
@Dested: Some ideas on rationale here: http://stackoverflow.com/questions/727516/what-does-the-unary-plus-operator-do
AakashM
+12  A: 

The unary plus operator has higher precedence than the addition operator, just split your expression into multiple grouped expressions and it will seem pretty obvious:

var m = 6 + ( +( +( +( +( +( +( +( 6 ))))))));
      //6 + 6
CMS
Exact-a-mundo, CMS.