Guía

En este desafío debes crear una función que usando fetch haga llamadas a APIs y debe contar las siguientes características:

La solución debería tener un input y ouput como los siguientes:

Output

// Error: Something was wrong

Solución

export async function runCode(url) {
  try {
    const response = await fetch(url);
    const data = await response.json();
    return data;
  } catch {
    new URL(url);
    return new Error("Something was wrong");
  }
}

Desplegando el proyecto

Conclusión