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

314
Views
Javascript: passing data down classes?

I have a class Third, that requires a token in its constructor to create it.

import Third from './Third.js'

export class Second {
    
   private _instanceOThird = new Third(_token)

   constructor(
      _token: string
   ) {} 
}

import Second from './Second.js'

export class First {
    
   init() {
       const _instanceOfSecond = new Second('MyToken');
   }
}

The issue is that the token from Second comes from yet another class, called First. Class Second doesn't use the token but just needs it so that Third can be created within it.
Is this an anti-pattern of passing around data?

about 4 years ago · Santiago Gelvez
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!