I try to use require in JS but I get the following error
Uncaught ReferenceError: require is not defined
I have to files.
main.js
:
const count = 9;
module.exports = count;
index.js:
const count = require('./index');
console.log(count);
How to use require?