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

168
Views
getting information from a javascript json object

I imagine this has been posted before but I wasn't able to find a data object specifically like this one. I'm struggling to understand how extract information from this data object in javascript. It's a parsed URL.

 data =  URL {
  href: 'http://localhost:8080/test.txt?cat=Mouse',
  origin: 'http://localhost:8080',
  protocol: 'http:',
  username: '',
  password: '',
  host: 'localhost:8080',
  hostname: 'localhost',
  port: '8080',
  pathname: '/test.txt',
  search: '?cat=Mouse',
  searchParams: URLSearchParams { 'cat' => 'Mouse' },
  hash: ''
}

I can retrieve the URLsearchParams data.searchParams, which returns { 'cat' => 'Mouse' }

What is this data structure called: { 'cat' => 'Mouse' }. I'm confused by the => And how do I retrieve the two objects 'cat' and 'Mouse' separately inside this data structure?

For example, retrieving then setting a variable equal to the first item, 'cat' and another variable equal to 'Mouse'

Thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

What is this data structure called: { 'cat' => 'Mouse' }.

That isn't a data structure. It's a visual representation of the data in the URLSearchParams object.

Look at the API documentation to see how to access it (e.g. data.searchParams.entries())


There is absolutely nothing JSON related to that.

about 4 years ago · Juan Pablo Isaza Report
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!