onesAndZeros
onesAndZeros

Reputation: 23

How do I display output in Repl.it using Javascript?

I'm trying to get the output to display to the console and I'm stuck on how to get that to happen. It doesn't give me any errors, but it also doesn't display anything when I run it. Any ideas/suggestions?

function testOne () {
  console.log("Detroit");
  alert("Detroit");
  print("Detroit");
}

Upvotes: 0

Views: 1430

Answers (1)

toh19
toh19

Reputation: 1229

After writing a function you have to call it in order to run the script written inside it. Here is a good tutorial about functions in javascript. Simply call your function as such:

function testOne () {
  console.log("Detroit");
}
testOne();

Upvotes: 1

Related Questions