Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 7

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?"

Submit Answer

Explanation / 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>