Aleksandro
2/1/2016 2:08:00 PM
On 01/02/16 07:44, Stefan Ram wrote:
> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>> < Math.floor()
>>> NaN
>> Is this specified by ECMAScript?
>
> In the meantime, I found this:
>
> »17 ECMAScript Standard Built-in Objects
>
> ...
>
> Unless otherwise specified in the description of a
> particular function, if a built-in function or
> constructor is given fewer arguments than the function
> is specified to require, the function or constructor
> shall behave exactly as if it had been given sufficient
> additional arguments, each such argument being the
> undefined value.«
>
> So, I hope that now I have found why »Math.floor()« behaves
> like »Math.floor( undefined )«. Please let me know if you
> think that the above quotation does /not/ apply here.
I don't see why this would not be the case, you give non-numbers to a
function that needs numbers, that's why you won't get a number either.