• 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?

About

Avatar for MaBe @MaBe started