JavaScript MCQ Javascript Classes MCQ Question #5014
Single Choice Easy

QWhat would the following JavaScript code produce?

const obj = { 10: 'arry', 21: 'barry', 23: 'carry' };  
console.log(Object.entries(obj)[2]);

ID: #5014 Javascript Classes MCQ 189 views
Question Info
#5014Q ID
EasyDifficulty
Javascript Classes MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A [
  • B [
  • C [
  • D [
Correct Answer

Explanation

The Object.entries() method is a built-in method in JavaScript that returns an array of a given object's own enumerable property [key, value] pairs. The order of the properties in the array is the same as the order in which they are enumerated in a for...in loop over the object.

Share This Question

Challenge a friend or share with your study group.