A few arrow function specification issues

Herby Vojčík herby at mailbox.sk
Sun Apr 22 01:24:55 PDT 2012



Angus Croll wrote:
>
>
> On Sat, Apr 21, 2012 at 1:56 PM, Axel Rauschmayer <axel at rauschma.de
> <mailto:axel at rauschma.de>> wrote:
>
>     Counter-question: Isn’t it clear when you create a function whether
>     it is going to be a non-method function or a method?
>
>
> It's clear to the implementer - Its not clear to a function that gets it
> as an argument - unless fn.prototype is checked

How is this different from checking the type of an argument? There are 
people who feel "safer" when the language checks the type for them. Then 
there is different school preferring dynamic typing (Smalltalk, Self, 
JS, ...), where the caller is to blame when it passes different type 
(and if the code must be foolproof, it should check somehow).

Do you always check all the argument if they are really numbers, 
strings, objects of concete type you want to get? I'd bet you don't.

This is the same.

Herby


More information about the es-discuss mailing list