Wow. I never knew about this. In years of working with javascript, I've never encountered views or typed arrays. I think I default to the wrong resources for javascript - Since I come at this from web design, I'm use to using resources focused on that, and this stuff, well, doesn't really come up in web design.
The whole thing makes a lot more sense having read that, and I see what the point of "views" are; I hadn't realized that there was that distinction between the view and the data in typed arrays. That's really powerful...
(also - I hope what I said above didn't come off as abrasive - I was trying to be silly, and recognize that I knew I was doing something wrong)
Does the Espruino have StringView? That would be super useful - I'm always turning Uint8Arrays into strings (so that I can concatenate them, and then write them to some device. I have to convert them to strings since I need to be able to prefix the data with a few bytes to tell the device what this blob of bytes is for, and I can't fit a simple array large enough in memory)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Wow. I never knew about this. In years of working with javascript, I've never encountered views or typed arrays. I think I default to the wrong resources for javascript - Since I come at this from web design, I'm use to using resources focused on that, and this stuff, well, doesn't really come up in web design.
The whole thing makes a lot more sense having read that, and I see what the point of "views" are; I hadn't realized that there was that distinction between the view and the data in typed arrays. That's really powerful...
(also - I hope what I said above didn't come off as abrasive - I was trying to be silly, and recognize that I knew I was doing something wrong)
Does the Espruino have StringView? That would be super useful - I'm always turning Uint8Arrays into strings (so that I can concatenate them, and then write them to some device. I have to convert them to strings since I need to be able to prefix the data with a few bytes to tell the device what this blob of bytes is for, and I can't fit a simple array large enough in memory)