I am trying to learn how to use Node, Mongoose, and Mongo by looking at code from GitHub.
What’s the purpose of this line:
PostProvider = function(){};
from: https://github.com/cmarin/MongoDB-Node-Express-Blog/blob/master/postprovider.js
To me, it seems like an empty function.
To simulate the “class-concept” in javascript, we have 3 ways. One of this way is to use the prototype feature. Example for a Apple class :
In your example, the PostProvider function has no attributes. So, “cmarin” declares an empty function :
And add some methods :