Shows the given message and waits for the answer. Returns the user's answer as boolean.
Only y and Y are considered as true.
If the stdin is not interactive, it returns false.
Examples
Example 1
const shouldProceed =confirm("Do you want to proceed?");// If the user presses 'y' or 'Y', the result will be true// If the user presses 'n' or 'N', the result will be falseconsole.log("Should proceed?", shouldProceed);