ESLint ERROR:'document' is not defined. [no-undef]
I have an ESLint error in my code, I have tried googling, but to little avail. The only similar issue I could find didn't have a fix. The problem is that when I put document.write("string");
into an if/else, I get an ESLint error, as you can see in the title. The same thing happens if I replace document.write("string");
with console.log("string");
Do note that the only knowledge I have for javascript is the code-academy regular JS course, and the make your own adventure text-game JS course.
//Events
Math.floor((Math.random() * 100) + 1 === this.eventChance);
if (this.eventChance <= 15) {
Math.floor((Math.random() * 100) + 1 === this.eventType);
}
if (this.eventType > 50) {
document.write("You have been raided!");
}
else
{
document.write("You managed to secure a humanitarian aid drop!");
}