1

In Python, one can use dir() to list the names of all modules and variables that are accessible at any point in the code. I wonder whether the same is possible in JavaScript.

I tried Object.keys(require('module')._cache); to see the modules, as indicated here, but I get 'require is not defined'.

Fachu
  • 11
  • 1
  • The question you are refering to is about Node.js. And Node.js != Browser. Therefore `require` is not available to you. – Palladium02 Oct 30 '22 at 09:33

0 Answers0