Find Your Hat


I’m currently doing the below project

I’m supposed to be printing the current state of the field with a .field method (task 3)
However, when I console log the arrays it returning an error.

Would be grateful if anyone could tell me where I am going wrong?

My code is below

const prompt = require('prompt-sync')({sigint: true});

const hat = '^';

const hole = 'O';

const fieldCharacter = '░';

const pathCharacter = '*';

class Field {


    this._field = field;


  print (){

    for (let i = 0; i < 3; i++){





const newField = new Field(

  [pathCharacter, fieldCharacter, hole],

  [fieldCharacter, hole, fieldCharacter],

  [fieldCharacter, hat, fieldCharacter]



This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.