Skip to main content
Participant
Oct 27, 2017 11:41 AM UTC
Question

What is wrong with this code?I am just learning and am mystified. I search the web and this forum but can't find any insight:

I am using Acrobat Pro DC

for(var i=0;i < 5;i++) {

     console.println(i);

}

undefined

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Karl Heinz  Kremer
Community Expert
Community Expert
Oct 27, 2017 12:15 PM UTC

A common misconception is that “undefined” is an error message. That’s not the case, it just means that your code did not return anything. In this case, it is actually an indication that something did run, just not the portion of the code you wanted to execute.

Translate
try67
Community Expert
Community Expert
Oct 27, 2017 11:47 AM UTC

Nothing is wrong with it... If you're not seeing an output it's probably because you're not executing it correctly.

You need to select the code with the mouse before running it. Otherwise it will only execute the line the cursor is on.

Translate