• Sat 2019.08.17

    'The linked codeburst.io article states'

    That is an article, of one author's opinion describing generalized Javascript and is not a design specification.

    The link to the article was to reveal by definition the difference between a parameter list and what an argument is. It isn't there to imply that what that author wrote is how Espruinio Javascript works.

    There is an enormous amount of effort that @Gordon and others put in to staying as accurate as the ECMA spec defines.

    https://www.espruino.com/Features

    As @allObjects points out in #9, under some circumstances, it isn't possible to be 100% compliant.


    'all other JavaScript implementations have a different understanding'

    Yes, agreed. And that is why we have specifications for each of the different implementations.
    So that we all are on the same page for each different implementation.

    This page isn't a specification as such, but does accurately describe each object and function as designed and utilized by Espruino.

    https://www.espruino.com/Reference


    While it might be that the behavior of the arguments object is not what is desired, or as implemented in another environment, it does in fact perform exactly as the Espruino web documentation informs us. See the Note heading which additionally describes the behavior:

    https://www.espruino.com/Reference#l__gl­obal_arguments

    This is why reviewing each method in the reference section is necessary during the design phase in order to avoid erroneous coding pitfalls as pointed out in this thread.


    I still get the impression that it is not understood, that it is an impracticality to expect a Javacript statement to output a valid value from an array that has an indexer that was assigned a value of 'undefined'. e.g.

    console.log( arguments[ 1 ] );
    
    Uncaught ReferenceError: "1" is not defined
    

    will output an error when it is assigned 'undefined' or was never initialized in the first place,
    as in the case when only arguments[ 0 ] is correctly initialized.

About

Avatar for Robin @Robin started