-
• #2
I'm afraid Espruino doesn't support setting the array length - however it's trivial to work around.
You can use either of:
- Array.slice : http://www.espruino.com/Reference#l_Array_slice
- Array.splice : http://www.espruino.com/Reference#l_Array_splice
- Array.pop : http://www.espruino.com/Reference#l_Array_pop
- Array.shift : http://www.espruino.com/Reference#l_Array_shift
Also, if you're after storing a whole lot of readings, maybe look at using Uint8Array/etc as they'll be vastly more efficient when storing large amounts of data.
- Array.slice : http://www.espruino.com/Reference#l_Array_slice
-
• #3
Thank you for support and all answers, I'm happy with it!
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:
console requests:
I can get a real array size only before trying to cut it.