mercredi 17 mars 2021

How do I generate random integers in javascript? [duplicate]

I need to have a function drawSomething(x,y,color,boolean) how do I generate random integers so the position of x and y displays somewhere in the canvas, the color could be any of the three, and the boolean could be either true or false? but everything randomly

let colors = ['red','yellow','blue'];

drawSomething(x,y,color,boolean)



Aucun commentaire:

Enregistrer un commentaire