Working on a Pixl,js with firmware 2v04 .
Sometimes parameter for function are stored in arrays and apply is used to convert array to parameter.
var numbers = [0,3,5,9,4]; console.log(Math.max.apply(null, numbers)); // output is 9
Try to use this for g.drawString()
var p = ["Hello", 10, 10]; g.clear(); g.flip(); g.setFont("4x6",2); g.drawString.apply(null,p); g.flip();
Screen does not show "Hello".
Is this the correct syntax to use it in class Graphics?
@MaBe started
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.
Working on a Pixl,js with firmware 2v04 .
Sometimes parameter for function are stored in arrays and apply is used to convert array to parameter.
Try to use this for g.drawString()
Screen does not show "Hello".
Is this the correct syntax to use it in class Graphics?