How do I document an object with JSDoc?

What’s the best way to document the source code of a simple JavaScript object (and its export) using JSDoc?

For example, I want to document the following object:

/** how do I JSDocument object baseAdder? */
const baseAdder  = {
    /** how do I JSDocument property base? */
    base: 1,
    /**
     * Add a number to base
     * @param {number} a the number to be added to base
     * @returns {number} the sum of the number plus base
     */
    f: function(a) {
        return this.base + a;
        }
    };

/** how do I JSDocument this export? Should I? */
module.exports = baseAdder;

127 thoughts on “How do I document an object with JSDoc?”

  1. I think this is one of the most significant info for me.
    And i am glad reading your article. But wanna remark on some general things, The website style is perfect, the articles is
    really great : D. Good job, cheers

    Reply
  2. Thanks for every other informative site. The place
    else may just I am getting that kind of info written in such an ideal means?
    I’ve a challenge that I am simply now operating on, and
    I’ve been on the glance out for such info.

    Reply
  3. Thank you for the good writeup. It in fact was a amusement
    account it. Look advanced to more added agreeable from you!
    However, how could we communicate?

    Reply
  4. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
    I’ve been looking for a plug-in like this for quite some time
    and was hoping maybe you would have some experience
    with something like this. Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new updates.

    Reply
  5. Hey There. I found your blog using msn. This is a very well written article.

    I’ll make sure to bookmark it and return to read more of
    your useful info. Thanks for the post. I’ll certainly return.

    Reply
  6. After going over a few of the blog posts on your website, I truly appreciate your way
    of writing a blog. I saved as a favorite it to my bookmark website list
    and will be checking back soon. Please visit my website as well and tell me
    your opinion.

    Reply
  7. Pingback: buy sildenafil
  8. Pingback: sildenafil viagra
  9. My coder is trying to persuade me to move to .net from PHP.

    I have always disliked the idea because of the expenses.
    But he’s tryiong none the less. I’ve been using WordPress on various websites for about a year and am concerned about switching
    to another platform. I have heard fantastic things about blogengine.net.

    Is there a way I can import all my wordpress posts into it?
    Any kind of help would be greatly appreciated! scoliosis surgery https://coub.com/stories/962966-scoliosis-surgery scoliosis surgery

    Reply
  10. Pingback: viagra generic
  11. Pingback: cialis on the web
  12. Pingback: viagra for sale
  13. Pingback: cialis orange pill
  14. Pingback: female viagra
  15. Pingback: viagra canada
  16. Pingback: cialis generico
  17. Pingback: generic cialis
  18. Pingback: sildenafil generic
  19. Can I simply just say what a comfort to find somebody who actually understands what they’re
    discussing over the internet. You actually understand how to bring a problem to light and make it important.
    More and more people really need to check this out and understand this side of your story.
    I was surprised that you aren’t more popular given that you certainly possess the gift.

    Reply
  20. Pingback: viagra sample
  21. Pingback: viagra on line
  22. Pingback: hims viagra
  23. Pingback: viagra ohne rezept
  24. Pingback: viagra vs cialis
  25. Pingback: viagra para mujer
  26. Pingback: herbal viagra
  27. Pingback: sildenafil
  28. Pingback: viagra pornhub
  29. Heya excellent website! Does running a blog such as this require a large amount of work?
    I’ve virtually no expertise in programming however I had been hoping to start my own blog soon. Anyhow, should
    you have any recommendations or tips for new blog owners please
    share. I understand this is off subject but I
    simply had to ask. Kudos!

    Reply