I'm trying to make a function call inside my module but I'm getting functionTwo
is not define.
Module.js
// Module.exports
module.exports = function ( arg ) {
if(arg instanceof Object) {
return functionTwo.apply(arg);
}
functionOne: function(arg) {}
functionTwo: function(arg) { //in here we may call functionOne or functionThree }
functionThree: function() {}
Main.js
require(module)(typeObject);
require(module)(typeString);
So basically what I'm trying to do is if the type that is being passed from main.js
to the module.js
was an Object
I want it to call a specific function and do something then just return, but I don't know maybe I'm defining the function wrong.
functionOne
and such part of?app.get( "/user/:userid", function( req, res ) {
get fired will call one of the function inside the module.require
from themain.js
and if the url that is enteredlocalhost:3000/user/:userid
will call some function in the module, but I can't figure out why I can do that.