Show quoted text> what's the point of returning the
> actual input here as opposed to just returning the boolean (which is
> what the docs seem to suggest). I can't see any reason to actually
> want whether I got a yYnN.
Maybe you want to know how eager they are? For example: 'y' vs 'YES!!!!!' ;-)
The real reason is simply to be consistent. prompt() always separates
the input (the string value returned) from the success status (the
boolean value returned).
For another example: if you just hit <ENTER> after a prompt, it returns
an input of "" (empty string), but a success status of true. If the
input and success were not consistently separated, that returned empty
string would be treated as false, even though the input operation
succeeded.
All the best,
Damian