Hi, I’m learning Javascript on a school chromebook, so I am unable to use Node, and if I can code in the browser, I’m not sure how. However, I think that the Codecademy IDE should have everything I need, I just need to know how to take inputs from the terminal. Can anyone tell me the proper commands?
I was able to eventually kind of solve the problem, but it is very strange. Basically, the prompt() function, after being imported, only worked when I imported it on a forked review file. On top of that, it only worked when I .load -ed the file into the terminal in the IDE, this also shows the code, but it kind of works in the most needlessly complicated way possible. I hope this is helpful to someone. Here’s the code:
const prompt = require('prompt-sync')();
let name = prompt('What is your name?');
let finish = prompt(`Your name is ${name}!`);
then enter
.load yourFile.js
into the terminal
Also, I forgot to mention that by ending the code on a prompt and resizing the terminal, you can only show the prompt and not all of the code to the user.