I want to get a variable from one .js file to another .js file. Right now I have main.js
const balances = require('./balance');
console.log(balances.balanceBTC)
and I have balance.js
const balanceBTC = () => {
return arrayCleaned[0];
};
exports.balanceBTC = balanceBTC;
And I am getting the error
const balances = require('./balance');
ReferenceError: require is not defined
I am running this code via windows PowerShell and the node version is: v14.10.1