You are reading a single comment by @7oo1er and its replies. Click here to read the full conversation.
  • Hello

    As I read in Internets, array.length can cut array to size. I need this to save only 100 last readings. But using lenght can, I think, cause some memory issues.
    code:

    a = new Array();
    a = [1, 2, 3, 4, 5, 6];
    console.log(a);
    

    console requests:

    >[ 1, 2, 3, 4, 5, 6 ]
    =undefined
    >a.length
    =6
    >a
    =[ 1, 2, 3, 4, 5, 6 ]
    >a.length = 2
    =2
    >a
    =[ 1, 2, 3, 4, 5, 6, "length": 2 ]
    > 
    

    I can get a real array size only before trying to cut it.

About

Avatar for 7oo1er @7oo1er started