skip to content
developertype

snippets

filter:96 snippets
js-gen-fetchjson·javascript·general
async function fetchJson(url) {
  const res = await fetch(url);
  if (!res.ok) throw new Error(res.statusText);
  return res.json();
}