Next button and Instruction check boxes stuck

Hi All,

I am on the 5/15 lessons on Learn Node.js:
https://www.codecademy.com/content-items/7e182ef11df387e8b51708a52df36515/exercises/modules

I completed Instruction 1: module.exports = class Cat
but the check box didn’t change, and the rest of the instructions remained grey. I checked the hint and saw that my line was correct. Since I could still read the greyed out instructions, I continued to Instruction 2: module.exports = class Dog (compared it with the hint)
And in Instruction 3 wrote the two require():
// Require modules in:

let Dog = require(’./dog.js’);

let Cat = require(’./cat.js’);

Then I called node app.js and received a result for the “dog-cat fight”.
I did this page several times, refreshed it, and got “Rex wins!”, and then “Taby wins!” and no error message:
node app.js Tabby wins!
But no change and the Next button remains stuck.

Please help!

Sounds frustrating. Not sure what the issue is without all the code, but I thought I would share mine and see if it helps.

cat.js:

module.exports = class Cat {
  constructor(name, clawStrength) {
    this.name = name;
    this.clawStrength = clawStrength;
  }
};

dog.js:

module.exports = class Dog {
  constructor(name, toothStrength) {
    this.name = name;
    this.toothStrength = toothStrength;
  }
};

app.js:

// Require modules in:

const Dog = require('./dog.js');
const Cat = require('./cat.js')

let fight = (dog, cat) => {
    if (dog.toothStrength > cat.clawStrength) {
        console.log(`${dog.name} wins!`);
    }
    else if (dog.toothStrength < cat.clawStrength) {
        console.log(`${cat.name} wins!`);
    }
    else {
        console.log(`${dog.name} and ${cat.name} are equally skilled fighters!`);

    }
}

const myDog = new Dog('Rex', Math.random());
const myCat = new Cat('Tabby', Math.random());

fight(myDog, myCat);

This passed for me. If you can spot any differences, maybe we can figure out what’s going wrong.

1 Like

Hi Brian,

Thank you so much for the response, and for sharing the code. I also got Rex and then Taby!
I don’t know why it happened. I refreshed the browser several times.
But then, today it did go through.

Thank you so much!
Sharon.

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