My problem is when I execute the program and insert the instructions I don’t see that print the new value in array 2d.
print() {
// I can prin the array, thanks design6726512087 he is in the forum of codecademy
console.clear();
this._fields.forEach(rows => {
console.log(rows.join(''));
});
}
playGame() {
while (!this.gameOver) {
this.print();
const promptInputUser = prompt("Instructions to move is: {u as up}, {d as down}, {l as left} & {r as right}.nWich is your path? ");
// Call the function to move into array
this.instructionsToMove(promptInputUser);
}
console.log("Game Over");
}
When I call the function in playGame() to print the instruction in array but throw a problem: TypeError: Cannot read properties of undefined (reading ‘forEach’).
Also I hope you can understand my english is not the better but I trying to write.