First, I'm just getting started with node js (look at the question), so please bear with me
This is a case I made to make my question clearer. I made a function to be called on another JS :
exports.test = function(req, res){
connection.query('SELECT * FROM `test`', function (error, results) {
console.log(results);
});
};
Then I can call it with object.test();
I want to generalize this function, by passing the table name from another JS, instead of hardcoding it. How to do that?
In Java, I could googling about this easily. However, on Node, almost all search results telling about the parameter in the url (POST/GET), but my need is to just passing a param/args to a function.
Thanks in advance