flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: I just learned something in Javascript
Date Mon, 02 Jan 2017 17:34:15 GMT
Where can I read more about this syntax?

Does the difference really move the needle?  Does GCC optimizer replace
Number with a shortened name anyway?

What if you take away all whitespace?

What should we generate for:

var bar = "1234";
var foo = Number(bar);

var foo = Number("12" + "34");

Sorry for all of the questions.  I'm trying to understand how much gain we
get for how much work.

Thanks,
-Alex

On 1/2/17, 9:23 AM, "Harbs" <harbs.lists@gmail.com> wrote:

>Or more concisely:
>
>console.log(20 + +"1234")
>< 1254
>
>On Jan 2, 2017, at 7:21 PM, Harbs <harbs.lists@gmail.com> wrote:
>
>> Apparently, yes:
>> 
>> > var foo = 20 + +"1234";
>> < undefined
>> > foo
>> < 1254
>> 
>> On Jan 2, 2017, at 7:13 PM, Alex Harui <aharui@adobe.com> wrote:
>> 
>>> var foo = 20 + +"1234";
>> 
>

Mime
View raw message