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

142
Views
Sorting - methods and properties of objects

enter image description here

Hey stackoverflow, I was working on a project that was meant to take the methods and properties of different API's and then making a system that would allow these to be chained together and used with less technical knowledge.

One of the basic requirements of this project is being able to parse out an object into its properties and its functions. Having tried a couple of different approaches with no luck, I noticed (see picture) that vscode could tell what parts of an object are methods and which are properties, which left me wondering how i could actually utilize this functionality, as in is there a function that would return all the properties of an object?

I know Object.keys() returns the string value of all the keys of an object, which is a good start, but i also need the actual objects held by these keys.

I've also stumbled onto Object.getPrototypeOf(obj), which returns the prototype of a function, and at least as far as i understand the prototype holds all the methods, and as such we should be able to go through all the prototypes nested inside the first prototype to find all the methods we can use. (atleast this is what im attempting next) One of the concerns I'm imagining is that some methods are also held in keys, and these wouldn't be caught in this way, I'm imagining.

So my overarching question is if there's a smart way to access these properties and methods or to simply sort it outright

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

0

You can use Object.entries() and get both, key and value // -> [[key, value], [key, value]]

Try:

let list = Object.entries(window).map(([key, value]) => ({[key]: typeof value}))

console.log(list)
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!