Here is the code below. The error was
/home/runner/NeedySlimSigns/index.js:27
SyntaxError: Unexpected end of input
// Program: Drake Party Conditions
// Date: 11/8/2022
console.log("Welcome to Drake's birthday party");
console.log("Let's see if you're a minor, Drake only wants minors at his party");
let maxAge = 17;
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
console.log()
let age = null;
let gender = null;
readline.question("How old are you?", age => {
if (age > maxAge) {
console.log("You are an adult. Drake only wants minors at his party, sorry.");
readline.close();
}
else {
readline.question("Are you a girl?", gender => {
if (gender == yes || gender == Yes) {
console.log("Perfect, welcome to Drake's party");
readline.close();
}
});
I was expecting the readline to work properly, but it seems like the issue lies with that.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/XPF9rd3
Comments
Post a Comment