• I know that there is always hunger for every thing to be in Espruino... ;-)

    This multi-assignment / array and object destructuring assignment could give some space relieve for quite many things (the example though does not really portray that):

    >var a,b,c;
    =undefined
    >[a,b,c]=[1,2,3]
    Uncaught Error: Unable to assign value to non-reference Array
     at line 1 col 15
    [a,b,c]=[1,2,3]
                  ^
    >
    

    Would work for returns from functions as well:

    >var a,b,c;
    =undefined
    >var trippler = function(){ return [1,2,3]; }
    =function () { ... }
    >[a,b,c] = trippler();
    Uncaught Error: Unable to assign value to non-reference Array
     at line 1 col 20
    [a,b,c] = trippler();
                       ^
    >
    

    I 'expect' only the simple implementation(s)... even though sometimes nothing is better than not all...

About

Avatar for allObjects @allObjects started