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
  • 723
  • 1
  • 8
  • 24

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
  • 21,963
  • 19
  • 86
  • 127