Code Editor
1 min
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(); };
Have a question?
Our knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.
