Java Script code not working

function trc (img,cw,ch,r,g,b) {
var image = new SimpleImage(img);

for (var pixel of image.values()){ var x = (ch);
var w = (cw);
var q = (r);
var e = (g);
var t = (b);
    if (pixel.getX()> (w)) {
    if (pixel.getY()< (x)) {

var picture = new SimpleImage(“chapel.png”);
var result = trc (picture, 30, 60, 255, 255, 0);
Can anyone tell why my code isn’t working?

Not sure what all that is about. Why not just use the parameters directly? Do you need all those variables? Also, parens are superfluous.

const x = ch

says the same thing. Still, all those variable declarations seem a might redundant.