Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

249
Vistas
Why can the first parameter of fetch() be a Request object?

From the API documentation

This defines the resource that you wish to fetch. This can either be:

  • A string or any other object with a stringifier — including a URL object — that provides the URL of the resource you want to fetch.
  • A Request object.

Simple question: "why"? The second parameter is init which seems to have all parameters that will be used to then make a Request object.

So:

  • Why giving the possibility of using EITHER a Request object as first parameter, OR an URL as first parameter and init value of a Request object as second parameter?

  • Is it allowed/spec'd to have BOTH a request object as first parameter, and an init object as second parameter? I assume the answer is "no" since none of the properties of the request object are writable... but in that case, should the documentation above specify that it's either a request object, or a URL + init parameters?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda