array length #1160
Unanswered
espruino-discuss
asked this question in
JavaScript
array length
#1160
Replies: 2 comments
-
Posted at 2018-03-08 by @gfwilliams I'm afraid Espruino doesn't support setting the array length - however it's trivial to work around. You can use either of:
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. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Posted at 2018-03-08 by 7oo1er Thank you for support and all answers, I'm happy with it! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-03-08 by 7oo1er
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.
Beta Was this translation helpful? Give feedback.
All reactions