Need Logical elaboration over invoking / calling the instance of a module

Viewed 25

I am a learner and I need some explanation over when to invoke or to simply call an instance of a module e.g.

const express = require('express');
const router = express.Router()

here, we have invoked the Router(), but some cases we do not invoke the instance e.g.

const redux = require('redux');
const createStore = redux.createStore;

where we did not invoke createStore. Could you please help me understand. (please ignore createStore as it says it is now deprecated. I took it as an example )

0 Answers
Related