---
title: Code Editor
slug: branching-53-space/code-editor
createdAt: 2026-05-19T09:41:00.000Z
---

```javascript
const fetchCake = async (id) => {
  const response = await fetch(`https://api.cakes.com/${id}`, {
    method: "GET",
    headers: {
      "Accept": "application/json"
    }
  });

  if (!response.ok) {
    throw new Error(`Request failed with status ${response.status}`);
  }

  return response.json();
};
```
