Cannot create a Uint8ClampedArray

Posted on
  • Using the web IDE, I try to load just this one line:

    var typedArray = new Uint8ClampedArray([1, 2, 3, 4]);
    

    ... and get this error:

    Uncaught Error: Constructor should be a function, but is undefined
     at line 1 col 22
    

    What am I missing?

  • Do you have up to date firmware installed?

    And which board are you using? Some of the non-Espruino boards have some things removed in order to fit Espruino into their smaller flash memory sizes.

  • I did not have up-to-date firmware; thanks for mentioning that. After upgrading it, I found the memory usage to be much better with arrays! Looks like it was some optimizations you did last year.

  • Great! Yes, I've been able to optimise it a bit in the last year or so. There'll be some more big improvements coming in 1v82 as well!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Cannot create a Uint8ClampedArray

Posted by Avatar for dbkingsb @dbkingsb

Actions