title: Drawing a line that is an element of an array in p5.js
body: <p>In my current p5.js project, I'm randomly plotting several lines on the canvas - so my background is in the setup function, but I wish to highlight the current one with a thicker stroke. In order to know which line was the last one drawn, I'm pushing them to a list to redraw just the last one later with a different stroke value. But I don't know how to display on the canvas such a line that is an element of an array. Somebody could help me?</p>
  <p>What I have done so far:</p>
  <pre><code>//just inicializing the x-coordinates of the limit point of my line
  let ax = 0;
  let bx = 0;
  
  //variables for the current line and the array of lines
  let linha;
  let linhas = [];
  
  function setup() {
    createCanvas(400, 400);
    background(0);
  }
  
  function draw() {
    //randomly choosing the x-coordinates of the limit point of my line
    ax = random(0,400);
    bx = random(0, 400);
    
    
    stroke(255, 50)
    //plotting the current line
    linha = line(ax, 0, bx, 400);
    //putting it on the array
    linhas.push(line);
    
    
    //what I wish to be doing is something like
    /* 
    strokeWeight(5);
    'print' linhas(linhas.length - 1)  //where by print I mean display on the screen the last of the lines and only it, i.e. in the n+1 iteration, I don't want to have the n-line with that thicker stroke.
    */
    
  
  }
  </code></pre>