K
K
Konstantin2020-07-28 17:35:44
JavaScript
Konstantin, 2020-07-28 17:35:44

How to call a function from a function?

export const applicationSidebarMenu = (application: IApplication) => {
    let sidebarMenuItems = {};
     function setSidebarMenuActive() {
          console.log(sidebarMenuItems);
     }
}


I want to use applicationSidebarMenuit as a repository - to call other functions from there Like
this:
applicationSidebarMenu. setSidebarMenuActive();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gimir, 2020-07-28
@Junart1

Why not make an object?

export const applicationSidebarMenu =  {
    sidebarMenuItems: {},
     setSidebarMenuActive() {
          console.log(sidebarMenuItems);
     }
}
applicationSidebarMenu.setSidebarMenuActive()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question