Why "true"&"false" in 8. Interactive JS?


#1

Hi,

Where and why do the "true" and "false" statements appear from in the small box on the right after clicking OK or cancel in the confirm box?

Thanks,
Tim.


#2

Please post your code.


#3

That's just the way the confirm() method works. If you click OK then it returns true, if you click cancel then it returns false.

When you get a little further along and learn about functions then you will find this a bit clearer.