London | 26-ITP-May | Russom Gebremeskel | Sprint 1 | Coursework#1384
London | 26-ITP-May | Russom Gebremeskel | Sprint 1 | Coursework#1384russom-g wants to merge 15 commits into
Conversation
…print afterwards
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
| What is the return value of `prompt`? | ||
|
|
||
| - A text string that input by the user is returned. No newline at end of file |
There was a problem hiding this comment.
What if the user clicked "Cancel" instead of "OK"?
There was a problem hiding this comment.
I run the code again and if "Cancel " clicked "null" is returned.
There was a problem hiding this comment.
Is the "null" you mentioned a string?
There was a problem hiding this comment.
No. Because the user didn't type or input anything
There was a problem hiding this comment.
-
When you says "null" is returned, I wasn't sure if you were referring to
null(a value representing 'nothing') or a string "null". So which null was you referring to? -
The user could type/input something and then clicked "Cancel". So it is not quite correct to say "the user didn't type or input anything".
There was a problem hiding this comment.
- I meant null representing nothing.
- You are right. I didn't explain it properly. The prompt didn't receive any value.
|
Thanks for clarification. All good. |
Learners, PR Template
Self checklist
Changelist
By referring to documentation, syntax and other type of errors fixed. Some of the program code explained line by line.