I’m having a function where I need to call another function which will be dynamic and I just know the function name.
For example, my function is
myfunction(obj){
otherfunction(?);
}
otherfunction maybe
otherfunction(obj){
}
or
otherfunction(){
}
I don’t know whether to pass the parameter or not.
How can I call the method?
JavaScript does not actually require you to pass all the parameters to a function. Or any parameters. Or, you can pass more parameters than the function names in it’s signature.
If the function defines a parameter, obj, but you just call it like
Then obj is just undefined.