While looking at my code with console in chrome i saw this error:
Uncaught ReferenceError: Invalid left-hand side in assignment LINE 99
But i can't understand what's wrong here
function drawMatrix(matrix, offset) {
matrix.forEach((row, y) => { //THATS LINE 99
row.forEach((value, x) => { //OF COURSE THATS LINE 100
if (value !== 0) {
context.fillStyle = colors[value];
context.strokeStyle = "#dee5e3";
context.lineWidth = 0.1;
context.strokeRect(x + offset.x, y + offset.y , 1, 1);
context.fillRect(x + offset.x,
y + offset.y,
1, 1);
}
});
});}
I'm pretty sure there must be an error even at line 100 then, probably related to =>
but i can't understand what kind. Can you help me?
The error says "left-hand side in assignment", so look for a maybe fault "assignment" like var a = b, and a is not present in this scope or something like this.
So, as @epascarello says, maybe the line number in the console does not match.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.