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

176
Views
How to stop repeating myself with JSDOC and ES6 classes
/**
 * Example Class
 * @property {string} name - The Object's name [A]
 */
class foo {
    /**
     * 
     * @param {string} name - The name to assign to the object [B]
     */
    constructor(name){
        /**
         * The object's name [C]
         * @type {string}
         */
        this.name = name;
    }
}

In this example I had to document name 3 times (2 times if we ignore the constructor parameter having a different purpose). With 4+ properties, it can get pretty packed.

Is there a way to:

  • Consolidate documenting properties before the class and inside the constructor [A] & [C]

  • Documenting the constructor input parameter and the instance parameter if they represent the same variable [B] & [C] :

constructor(name){ this.name = name}
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!