Write the JavaScript to declare a variable called breakfast and initialize it wi
ID: 3806189 • Letter: W
Question
Write the JavaScript to declare a variable called breakfast and initialize it with the data the user enters in response to a prompt that asks the user "What would you like for breakfast?"
Write a JavaScript function that displays in a dialog box the data type of the variable x, where x is passed to the function as a parameter.
Requirement # Requirements 7Write the JavaScript to declare a variable called breakfast and initialize it with the data the user enters in response to a prompt that asks the user "What would you like for breakfast?"
Submit AnswerExplanation / Answer
Question 7
Answer:
<!DOCTYPE html>
<html>
<body>
<script>
var breakfast = prompt("What would you like for breakfast? ");
</script>
</body>
</html>
Question 8
Answer:
<!DOCTYPE html>
<html>
<body>
<script>
showType("1");
function showType(x) {
alert(typeof(x));
}
</script>
</body>
</html>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.