My code is going like this:
function printPixel(nameImage, xpos, ypos) {
var someImg = new SimpleImage(nameImage);
var pix1 = someImg.getPixel(xpos,ypos);
return pix1.getRed();
}
console.log(pix1)
printPixel("drewgreen.png",10, 10);
printPixel("drewgreen.png",250, 500);
The output always tells me that "pix1 is not defined", could you help me with my code? P.S: I edit the code in an online interpreter and the pngs have been uploaded already