Quiz Space

Modern Application Development II · Quiz 1 · 26 Oct 2025 · September 2025 term

Question 11: Consider the following JavaScript code snippet: What wil…

Question 11

+4.5 marksOne correct option

Consider the following JavaScript code snippet:

javascript
const products = [
{ name: 'Laptop', price: 1200, category: 'Electronics', inStock: true },
{ name: 'Book', price: 25, category: 'Education', inStock: false },
{ name: 'Phone', price: 800, category: 'Electronics', inStock: true },
{ name: 'Pen', price: 5, category: 'Stationery', inStock: true },
{ name: 'Tablet', price: 600, category: 'Electronics', inStock: false }
];
const result = products
.filter(item => item.category === 'Electronics' && item.inStock)
.map(item => ({ ...item, discountedPrice: item.price * 0.9 }))
.filter(item => item.discountedPrice > 500);
console.log(result.length);
console.log(result[0].name);

What will be the output of the above code on the browser's console?

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

Correct answer

  • B

Question 11 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 1 paper sat on 26 Oct 2025, in the September 2025 term (IIT M DIPLOMA AN EXAM QDD2 26 Oct 2025). It carries 4.5 marks.

More questions from this paper

  1. Q1Which of the following Vue 2 template syntaxes are valid?
  2. Q2Which of the following statements about Vue 2 templates are correct?
  3. Q3Consider the following JavaScript code: What will be printed on the console?
  4. Q4Consider the following JavaScript code snippet. What is logged on the console?
  5. Q5Consider the following JavaScript code snippet. What is logged to the console?
  6. Q6Figure question
  7. Q7Consider the following HTML, with the correct Vue 2 CDN links included What will be displayed for "Total Cost" and "Ord…
  8. Q8Consider this nested loop is written in JavaScript: Which of the following statements is/are true?
  9. Q9Consider the following HTML and JavaScript code. HTML file Among the following console log statements, which ones will …
  10. Q10Consider the following HTML and JavaScript, assume Vue 2 CDN link to be already included. index.html: app.js: How many …
  11. Q12Consider the below JavaScript program: What will be the output of the above program on the browser's console, if execut…
  12. Q13Consider the following JavaScript code: Which of the following statements are true?
  13. Q14Figure question
  14. Q15Read the Vue.js code and answer the given subquestions. The parent binds an input with v-model and passes the value as …
  15. Q16Read the Vue.js code and answer the given subquestions. The parent binds an input with v-model and passes the value as …