Problem description:
I’m trying to execute some code but the console seems to be not working, is there a bug or something?? I tried it on a different PC and it runs
Expected behavior:
something on the console
Actual behavior:
console outputs nothing, not even running
Browser/OS/Device:
google chrome
Hey @sequeraraulalej! Welcome to the community!
You can try a cache refresh of the Replit website by pressing Shift + Ctrl + R on your keyboard.
5 Likes
i tried that, yet not working
1 Like
Does the issue occur on all Repls or is it just one?
If it is, could you provide a link to that Repl.
1 Like
it occurred to every single repl I’ve created yesterday It was working correctly but today is not
Can you provide some screenshots and a minimal Repl which reproduces the issue?
2 Likes
hello ah the same the problem I tried refreshing the page as well
function generate(userchoice,cpuchoice){
if(cpuchoice.toLowerCase() === userchoice.toLowerCase()){
alert("its a tie")}
else if((cpuchoice.toLowerCase() === "snake",userchoice.toLowerCase() ==="water")
(cpuchoice.toLowerCase() === "gun",userchoice.toLowerCase() ==="snake")
(cpuchoice.toLowerCase() ==="water", userchoice.toLowerCase() === "gun") )
alert("cpu won ,you lose")
else{
alert("you won")
}
}
const userchoice = prompt("whats your choice?")
const game = ["snake","water", "gun"]
const random = Math.floor(Math.random()*3)
const cpuchoice = game[random]
console.log("cpu has chosen =" + cpuchoice)
console.log(generate(userchoice,cpuchoice))
this code is working absolutely fine in chromes console … but its not responding in replits console … whats the catch let me know pls
Chrome’s console is VanillaJS, but if you run it as NodeJS, it will not work because of the prompt() statement. The solution to this is to create a HTML, CSS, JS repl and make the contents of the script.js file be the code snippet your posted above.
1 Like