value is a string containing the default value displayed in the text
input field. It is an optional parameter. Note that in Internet
Explorer 7 and 8, if you do not provide this parameter, the string
"undefined" is the default value.
I'm going to assume that you wrote parenthesis parentheses but meant parameter. I'm assuming this because you also mentioned the comma character and that only appears within the argument list of the command...
The second parameter in the prompt command is the default value that is inserted into the text field.
The second param is for a
value
argument:https://developer.mozilla.org/en-US/docs/DOM/window.prompt
The second parameter in the prompt command is the default value that is inserted into the text field.
Here is a simple example -
{}
defines an empty code block. It does exactly nothing.It makes more sense to have a code block after control structures such as
if
andfor
.