Pro tip: Use `axios` instead of fetch for rest api request javascript stuff. Way simpler syntax and better error handling out of the box.
Example:
```javascript
axios.get('https://api.example.com/data')
.then(response => console.log(response.data))
.catch(error => console.log('Error:', error.message));
```
No need to manually check response.ok or parse JSON. Plus, it works with async/await cleanly.
Example:
```javascript
axios.get('https://api.example.com/data')
.then(response => console.log(response.data))
.catch(error => console.log('Error:', error.message));
```
No need to manually check response.ok or parse JSON. Plus, it works with async/await cleanly.
