var yPos = 0.0;
function setup() {  // setup() runs once
    createCanvas(100, 100);
    frameRate(30);
}

function draw() {  // draw() loops forever, until stopped
    background(204);
    yPos = yPos - 1.0;
    if (yPos < 0) {
        yPos = height;
    }
    line(0, yPos, width, yPos);
}
    

Class was not ported into P5 & classes in Javascript are different than in Processing (java)

They are created like functions, and thus, there's no special Class syntax. You can read more about this on Mozilla MDN