1
   return {
        init: () => {
             console.log('init')
        },
        run: () => {
            init()
        }
    };

how to call init function from run function as code is already developed and cant modify need to call like this only

nilesh
  • 653
  • 1
  • 7
  • 22

1 Answers1

0

Maybe something like:

var someObjectName = {
    init: () => {
         console.log('init')
    },
    run() {
        return this.init()
    }
};
someObjectName.run()

or

var someObjectName = {
    init: () => {
         console.log('init')
    },
    run() {
        return this.init()
    }
}.run();
caramba
  • 19,727
  • 15
  • 78
  • 118