Question: Syntax example for prompt function: var myName = prompt ( Enter your name ) ; Syntax example for alert function: alert ( My name is
Syntax example for prompt function:
var myName promptEnter your name;
Syntax example for alert function:
alertMy name is myName;
Syntax example for displaying a number with a precision of decimals:
alertThe number is someNumber.toFixed;
Note: toFixed might not produce a precise rounding in some cases. Well use
it as is
Syntax example to use toFixed to display a number that was captured directly via a text box
as illustrated below, a previous line would be required prior to the display:
numberWins NumbernumberWins;
alertThe number is numberWins.toFixed;
Syntax example to display output in separate lines using escape mechanism
the following
example will display the contents of variables x and y in separate lines inside an alert window:
alertx
y;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
