Why just write a field and do nothing with it?

I read the source of the mongoose, find this code in https://github.com/LearnBoost/mongoose/blob/master/lib/collection.js#L23 :

/**
 * The collection name
 *
 * @api public
 */

Collection.prototype.name;

I do not understand why this line exists. Is it here just for document generation?

+5
source share
1 answer

Yes.

This helps everyone who reads the code to know that this property is for public access and helps the doc generator signal the same way.

+4
source

All Articles