Interesting. Does it work everywhere? var foo = 20 + Number("1234");
Would that compile to the following and still work? var foo = 20 + +"1234"; -Alex On 1/2/17, 3:08 AM, "Harbs" <harbs.li...@gmail.com> wrote: >Apparently Number(“1234”) is the same as a shorthand version: +”1234”. >Both of these will convert a string into a number and will give NaN if >the string can not be converted to a logical number. > >Performance-wise, different browsers seem to give different results as to >which one is faster. > >I think we should make it standard practice to use “+” instead of >Number() for casting to Number in FlexJS. It will save 7 characters for >every cast. > >Harbs