Quiz Space

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

Question 3: Consider the following JavaScript code: What will be prin…

Question 3

+3 marksOne correct option

Consider the following JavaScript code:

javascript
let employees = [
{ name: "Rahul", age: 28 },
{ name: "Priya", age: 24 },
{ name: "Amit", age: 32 }
];
employees.sort((a, b) => a.age - b.age);
console.log(employees.map(e => e.name).join(" - "));

What will be printed on the console?

  1. A

    Rahul - Priya - Amit

  2. B

    Priya - Rahul - Amit

  3. C

    Amit - Rahul - Priya

  4. D

    Priya - Amit - Rahul

Show answer

Correct answer

  • B

    Priya - Rahul - Amit

Question 3 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 3 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. Q4Consider the following JavaScript code snippet. What is logged on the console?
  4. Q5Consider the following JavaScript code snippet. What is logged to the console?
  5. Q6Figure question
  6. Q7Consider the following HTML, with the correct Vue 2 CDN links included What will be displayed for "Total Cost" and "Ord…
  7. Q8Consider this nested loop is written in JavaScript: Which of the following statements is/are true?
  8. Q9Consider the following HTML and JavaScript code. HTML file Among the following console log statements, which ones will …
  9. Q10Consider the following HTML and JavaScript, assume Vue 2 CDN link to be already included. index.html: app.js: How many …
  10. Q11Consider the following JavaScript code snippet: What will be the output of the above code on the browser's console?
  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 …