Cuando intento exportar variables como esta
const test1 = [ {numbder:'one', name:'user',tag: 'test'} ] const test2 = [ {numbder:'one', name:'user',tag: 'test'} ] module.exports = { test1, test2 }y lo importo así
const test = require('./test.js') myfunction function () { console.log(test1 +'and'+ test2) }me sale este error:
ReferenceError: Cannot access 'test1' before initialization¿alguien podría explicarme cuál es el problema?