So I am confused at the Freeform Project Dog Years. The prompt line, which creates the error in Dog Years, does work when copied in Kelvin Weather. If I copy the prompt line I wrote from Kelvin Weather, which works in that project, to Dog Years, it also creates this error message.
Am I doing something wrong, or is this a bug? I’d really like to know because I cannot find what I’m doing wrong.
/home/ccuser/workspace/learn-javascript-intro-dog-years-2/app.js:2
const myName = prompt(‘What is your name?’);
^
ReferenceError: prompt is not defined
at Object. (/home/ccuser/workspace/learn-javascript-intro-dog-years-2/app.js:2:16)
at Module._compile (module.js:571:32)
at Object.Module._extensions…js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)
at startup (bootstrap_node.js:151:9)
at bootstrap_node.js:542:3
// prompt the user for his name
const myName = prompt('What is your name?');
// assigns my age as value to myAge
const myAge = 22;
// sets the value of earlyYears to 2
let earlyYears = 2;
// Multiple earlyyears by 10.5 to equal early years of a dog
earlyYears *= 10.5;
// the early years have been used in the formula, so subtract those years from my age
let laterYears = myAge - 2;
laterYears *= 4;
myAgeInDogYears = earlyYears + laterYears;
console.log(`My name is ${myName}.`);
console.log(' I am ' + myAgeInDogYears + ' in dog years.');