Quiz Space

Modern Application Development II · Quiz 2 · 16 Mar 2025 · January 2025 term

Question 10: Consider the following javascript code. What's logged?

Question 10

+3 marksOne correct option

Consider the following javascript code.

javascript
function translateToEmoji(msg, dictionary, cb) {
const translated = msg
.split(' ')
.map(word => dictionary[word] || word);
cb(translated.join(' '));
}
translateToEmoji('i love code',
{ heart: '🤎', code: '💻' },
result => console.log(result));

What's logged?

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

Correct answer

  • D

Question 10 of 16 in the IIT Madras BS Modern Application Development II (MAD 2) Quiz 2 paper sat on 16 Mar 2025, in the January 2025 term (IIT M DIPLOMA AN EXAM QDD2 16 Mar 2025). It carries 3 marks.

More questions from this paper

  1. Q1Figure question
  2. Q2Figure question
  3. Q3Figure question
  4. Q4Consider the below javascript program. What will be the output of the above program?
  5. Q5Consider the below javascript program. What will be the output of the above program?
  6. Q6Figure question
  7. Q7Consider the below Vue router setup. What will be the behavior when the user visits “/products/123/reviews”?
  8. Q8Consider the below Vuex setup. What will happen if the user dispatches the “addItemToCart” action to add a new item to …
  9. Q9Consider the following javascript code. When the function is called what will be returned if the server is unreachable?
  10. Q11Consider the following html with relevant vue cdn links added. If a user clicks rapidly twice (within 500ms), what will…
  11. Q12Consider the following html with relevant vue cdn links added. In the Vue application above, what will be the initial r…
  12. Q13Consider the below javascript program. What will be the output of the above program?
  13. Q14Consider the below Vue router setup. Note: Assume that the API “/api/users/userId” is operational and returns the user’…
  14. Q15Consider the below Vue.js application. What will be the visited pages history when the user navigates between pages and…
  15. Q16Consider the below Vue.js application. What will happen if the user submits the form and reloads the page?