Quiz Space

Modern Application Development II · End Term · 28 Apr 2024 · January 2024 term

Question 1: Consider the following Script embedded in an HTML documen…

Question 1

+2 marksOne correct option

Consider the following Script embedded in an HTML document.

javascript
let langName = 'Python';
function showLanguage() {
let langName = "JavaScript";
let message = 'Learn ' + langName;
console.log(message);
}
let message = 'Learn ' + langName;
console.log(message)
console.log(showLanguage());

What will be the output on console, if the HTML document is rendered using a browser?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 1 of 32 in the IIT Madras BS Modern Application Development II (MAD 2) End Term paper sat on 28 Apr 2024, in the January 2024 term (IIT M FOUNDATION DIPLOMA AN EXAM QDF3 28 Apr 2024). It carries 2 marks.

More questions from this paper

  1. Q2Consider the following Script embedded in an HTML document. Which of the following statement is correct, if the HTML do…
  2. Q3Assuming the URL gives a valid json response, what will be the output in the console?
  3. Q4Which of the following statements is false regarding JavaScript and its behavior?
  4. Q5Where is system state commonly stored in a web application?
  5. Q6Which technology is commonly used to manage application state in a Vue.js application?
  6. Q7Consider the following Script embedded in an HTML document. Which of the following statements will throw an error on th…
  7. Q8Consider the following two HTML documents and the Vue app created in script.js file and select the correct option(s). i…
  8. Q9Consider the following Vue application and the rendered HTML output below. Filename: script.js Rendered output: mad 1 m…
  9. Q10Which of the following HTTP status code(s) is/are commonly used in RESTful APIs for successful responses?
  10. Q11Which of the following is/are potential benefit(s) of using caching in web applications?
  11. Q12Consider the following Script embedded in an HTML document. What will be the output on console, if the HTML document is…
  12. Q13Consider the following Script embedded in an HTML document. What will be the output on console, if the HTML document is…
  13. Q14What will be the text displayed in a web page if the Vue app given below is running in a development mode? Filename: in…
  14. Q15Consider the following Script embedded in an HTML document. What will be the output on console, if the HTML document is…
  15. Q16What does the “finally” method do in promises?
  16. Q17Which of the following statements regarding Celery task execution is correct?
  17. Q18What is the primary objective of using a message broker?
  18. Q19In a message broker system, what does the term "topic" refer to?
  19. Q20What is the primary advantage of using server-sent events over traditional polling?
  20. Q21Which of the following protocols is commonly used for implementing polling?
  21. Q22What is the primary purpose of CORS in web security?
  22. Q23Consider the following Script embedded in an HTML document. What will be the output on console, if the HTML document is…
  23. Q24Consider the following Script embedded in an HTML document. What will be the output on console, if the HTML document is…
  24. Q25Consider the following Script “script.js” embedded in an HTML document, “index.html” and an external script “app.js” gi…
  25. Q26Consider the below JavaScript program. What of the following can be used in place of “placeholder” in the above program…
  26. Q27Consider the below JavaScript program. What will be the output of the above program, if executed?
  27. Q28Consider the following Vuex module definition for managing a shopping cart. Which of the following options correctly co…
  28. Q29Consider the following Vue application with markup “index.html” and JavaScript file “app.js”. index.html: app.js: Suppo…
  29. Q30Consider the following Vue application with markup “index.html” and JavaScript file “app.js”. index.html: app.js: Based…
  30. Q31Which of the following is/are built in Vue.js lifecycle hook(s)?
  31. Q32Which of the following JavaScript method(s) is/are used to remove data from the session storage?