Reputation: 1
I'm building a website with Glitch. When you press F12 on the webpage and enter the console, I want to be able to respond to a specific input to produce an outcome. Like, if the user types 'hello world'
it should log 'lorem ipsum'
in the console in response. I've tried readline()
but that doesn't seem to work.
//in script.js:
const readline = require('readline');
var y = readline();
if (y == "hello world"){
console.log("lorem ipsum");
}
What am I doing wrong? Or does readline()
not work?
Upvotes: 0
Views: 297