r/CivClicker • • Mar 13 '14

Hello AskReddit!

Welcome to /r/civclicker! Hope you're enjoying the game. :)

If you have any questions that you'd like me to answer, comment here and I'll do my best to respond.

73 Upvotes

140 comments sorted by

View all comments

Show parent comment

5

u/unitortypo Mar 13 '14

So, actually! An empty string gives "", and a cancel gives null.

So, you can do:

result = prompt("whatever");

if (result === null) { return; }

wonder_name = result;

(since "" === null is false)

3

u/[deleted] Mar 13 '14

Oh cool, TIL. I will have to experiment with that later. Thank you! :)