is there a way to dynamically set a parameter, or property for a function in javascript? some examples:
const funcOne = (param1, param2) => console.param1(param2);
funcOne(log, `hello there`);
obviously the above doesnt work, just bring an example, same as below:
const mongoFunc = param, filter => Collection.param(filter, (err, foundArticle) => {
// code block
});
this will work:
const funcOne = (param1, param2) => console.log(param1, param2);
funcOne(`hello`, `there`);
so I was wondering if theres a dynamic way to set the log in console.log same as when it comes to mongo to dynamically set Collection.find or collection.findOneAndUpdate.
Thank you in advance.