To iterate over the entries of an object (key-value pairs), the object should be converted to an array of arrays using Object._______.

  • entries
  • toArray
  • keys
  • values
To iterate over the entries (key-value pairs) of an object, the object should be converted to an array of arrays using Object.entries. This method returns an array containing arrays, each with two elements: the key and its corresponding value from the object. You can then iterate over these pairs.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *