6.1.6: JavaScript practice.
The JavaScript code below initializes the variable tvShow to a popular TV show. Then, an if statement displays a message in the console if tvShow is null, otherwise the value of tvShow is displayed in the console. Change the code to prompt the user for the user's favorite TV show. Then, display "____ is your favorite TV show!" in the console. Press "Run JavaScript" to run your code.
Note: The console will display an error message if the JavaScript interpreter detects a syntax error. A syntax error is the incorrect typing of a programming statement. Ex: Forgetting to place "quotes" around a string value is a syntax error.
1 Use prompt to get the user's favorite TV show
2 var tvShow = "Sherlock";
3
4 if (tvShow === null) {
5 console.log("You did not enter a TV show.");
6 }
7 else {
8 console.log(tvShow);
9 }
10
Run Javascript Reset code
Your console output
sherlock
6.1.1: prompt() and console.log().
Start
Write a statement that displays: 3 2 1 Go!
1
2
3
/* Your solution goes here */
1
2
3
Check
Next
`Hey,
Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
1)
var tvShow = prompt("Enter tv show:
","");
if (tvShow === null) {
console.log("You did not enter a TV show.");
}
else {
console.log(tvShow+" is your favorite TV
show!");
}

Note: Brother According to Chegg's policy we are only allowed to answer first part if there are many. So, I request you to post other part as separate posts
Kindly revert for any queries
Thanks.
6.1.6: JavaScript practice. The JavaScript code below initializes the variable tvShow to a popular TV show....