Equivalent of "window["functionName"](arguments)" in server-side

equivalent synonyms
equivalent math
equivalent verb
how to pronounce equivalent
equivalent in hindi
equivalent to something
equivalent vs equal

What is the equivalent code of window["functionName"](arguments) in NodeJS server-side?

you're looking for global

Note, however, that in modules nothing is ever exposed to this level

EQUIVALENT, as another thing. The most common preposition used with this adjective is to: 150 grams are equivalent to a medium-sized potato. James thought  equivalent definition: 1. having the same amount, value, purpose, qualities, etc.: 2. something that has the same amount…. Learn more.

If you need such a capability within a module, one hack is to store such module functions in variables within the module and then call them by accessing them from the module object properties. Example:

var x = { }; // better would be to have module create an object
x.f1 = function()
    console.log('Call me as a string!');

Now, within the module, you can call it using the value from a string:

var funcstr = "f1";

I am learning the ropes with Node myself, the above is probably all sorts of wrong :-). Perhaps a marginally better way to write this example would be (for the module m.js):

module.exports =
    f1: function() { console.log("Call me from a string!"); },
    f2: function(str1) { this[str1](); }

Now you can:

var m = require('m.js');

Or even just:

var m = require('m.js');


Equivalent TO or OF, Equivalent definition, equal in value, measure, force, effect, significance, etc.: His silence is equivalent to an admission of guilt. See more. Definition of equivalent. 1 : equal in force, amount, or value also : equal in area or volume but not superposable a square equivalent to a triangle. 2a : like in signification or import. b : having logical equivalence equivalent statements. 3 : corresponding or virtually identical especially in effect or function.

1) If methods are in same js file

define all methods as properties of Handler:

var Handler={};

Handler.application_run = function (name) {

Now call it like this

var somefunc = "application_run";
Handler[somefunc]('jerry codes');

Output: jerry codes

2) If you want to keep methods in a different js file
//    Handler.js
    application_run: function (name) {

Use method defined in Handler.js in different.js:

//    different.js
var methods = require('./Handler.js')   // path to Handler.js
methods['application_run']('jerry codes')

Output: jerry codes

Equivalent, From Longman Dictionary of Contemporary Englishequivalente‧quiv‧a‧lent1 /​ɪˈkwɪvələnt/ ○○○ W3 AWL adjective SAMEEQUALhaving the same value,  Here, 'equivalent' is an adjective. The dog's age is equivalent of 150 in human age. is this correct?? No. The dog's age is the equivalent of 150 in human years.Here, you are using 'equivalent' as a noun, so you need an article.

If you want to call a class level function using this then following is the solution and it worked for me

class Hello {
  sayHello(name) {
    console.log("Hello " + name)
  callVariableMethod() {
    let method_name = 'sayHello'
    this[`${method_name}`]("Zeal Nagar!")

equivalent, I learned a simple trick a long, long time ago that still serves me to this day when dealing with prepositions, which admittedly, as a native  Equal, as in value, meaning, or force. Of or relating to a relation between two elements that is reflexive, symmetric, and transitive. Having a one-to-one correspondence, as between parts. Two triangles having the same area are equivalent, as are two congruent geometric figures.

If You need it in module scope, You can use something like this

var module = require('moduleName');


vs. "[a/the] equivalent for" vs., How to use equivalent in a sentence. Example sentences with the word equivalent. equivalent example sentences. gram equivalent. n. The weight of a substance, usually in grams, that combines or reacts with a standard weight of a reference element or compound. The atomic or molecular weight in grams of an atom or group of atoms involved in a reaction divided by the valence.

Use equivalent in a sentence, One dollar is equivalent to/of one Australia dollar. Are both "to" and "of" correct in this case? Since 'equivalent' means 'having the same worth as', the idea is that you can 'exchange one thing for another'… so, without any context, the preposition 'for' is the one that makes most sense, even if it is not the one that is used most.

equivalent to vs equivalent of, Learn how to use Equivalent using many example sentences. Learn collocations of Equivalent with free vocabulary lessons. Equivalent fractions are fractions with different numbers representing the same part of a whole. They have different numerators and denominators, but their fractional values are the same. For example, think about the fraction 1/2.

How to Use Equivalent with Example Sentences, What does equivalent mean? equivalent is defined by the lexicographers at Oxford Dictionaries as Equal in value, amount, function, meaning, etc. This is equivalent to 38,000 jobs. In Canada the equivalent to the U. A portion of potatoes is equivalent to a handful (equal to the size of your hand). Or if something is described as being a send-up it is equivalent to your take-off. Total energy savings would then be equivalent to 62 billion kWh and worth over $5.

  • @infact can you tell what you are looking for ?
  • this does not seem to work for me. Is it also works for "calling functions"?
  • global[ 'functionName' ]( ... ) will work if the function is at the global level. But as I said, modules don't expose anything to that level, they're all wrapped in an anonymous scope.
  • @MarkKahn, so how to call them?
  • This is a more sustainable, maintainable, and normalized OO approach for JS. Thx.
  • Thanks I had to use something like this in some hard to abstract code today.
  • Excellent, i just needed x[funcstr](); because the method was added by some other plugin.
  • elegant solution.
  • Yes indeed. However I am looking for a way to calling functions by name specifically.