Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

253
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!