// ... const BASE_URL = 'https://jsonplaceholder.typicode.com'; const getTodoItems = async () => { try { const response = await axios.get(`${BASE_URL}/todos?_limit=5`); const todoItems = response.data; console.log(`GET: Here's the list of todos`, todoItems); return todoItems; } catch (errors) { console.error(errors); } };
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter