> For the complete documentation index, see [llms.txt](https://adam-37.gitbook.io/joomadeung/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adam-37.gitbook.io/joomadeung/javascript/javascript/obejct.values-object.entries.md).

# Obejct.values() / Object.entries()

```tsx
const fetchMeals = async () => {
    try {
      const res = await fetch(
        '<https://react-http-8dd13-default-rtdb.firebaseio.com/meals.json>'
      );
      const data = await res.json();
      const values = Object.values(data);
      const entries = Object.entries(data);
      console.log('mealsArr2', mealsArr2);
      console.log(mealsArr);
      setMeals(mealsArr);
      return mealsArr;
    } catch (err) {
      console.log(err);
      return [];
    }
  };
```

```tsx
// entries

[Array(2), Array(2), Array(2), Array(2), Array(2)]

Array(2)
0: "m1"
1: {description: 'yummy', id: 1, name: 'Sushi', price: 16.99}
```

```tsx
// values

[{…}, {…}, {…}, {…}, {…}]

0: {description: 'yummy', id: 1, name: 'Sushi', price: 16.99}
1: {description: 'A german specialty!', id: 2, name: 'Schnitzel', price: 16.5}
2: {description: 'American, raw, meaty', id: 3, name: 'Barbecue Burger', price: 12.99}
3: {description: 'good', id: 4, name: 'refactoring', price: 20}
4: {description: 'good', id: 5, name: 'egg', price: 20.21}
```

`Object.values()` 메소드를 사용하여 객체의 값을 추출할 때는, 속성 이름을 알아낼 수 없는 한계가 있음.

만약 속성 이름을 함께 추출하고자 한다면, `for...in`루프나 `Object.entries()` 메소드를 사용해야 한다.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://adam-37.gitbook.io/joomadeung/javascript/javascript/obejct.values-object.entries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
