S
S
Sashqa2020-01-24 14:41:27
Node.js
Sashqa, 2020-01-24 14:41:27

Opening and calling functions from node js array?

I have an array of view objects

[ { fname: 'функ1', libname: 'contract' } ]
[ { fname: 'функ2', libname: 'contract' } ]

libname - the name of the required file
fname - the name of the desired function
export const contract: ValidationFunction[] = [
  {
    fname: "функ1",
    func: (contract) => {
      console.log('1);
    }
  },
  {
    fname: "функ2",
    func: (contract) => {
      console.log('1)
    }
  }
]

Task:
Walk through the array, read the files from libname and call the functions that are in the object with fname
I hope I explained it clearly :D

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question