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

190
Views
How can I get intellisense for an object called with an unknown variable?

i'm developing a discord.js bot and I have an object (called dtm) that keeps all users' data. It has this structure:

{
// id of the user : {data}
"92875891383" : {wallet: 100}
}

If in the code I use dtm[interaction.user.id] I don't get intellisense for the user's parameters, I think because intellisense doesn't know what interaction.user.id is. How can I achieve this? I thought with JSDoc, but i don't know quite how to achieve this...

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

0

Found it. I used this JSDoc:

/**
 *
 * @returns {{[key: string] : theSchema}} playerData 
*/

And it finally worked! Thank you

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!