I have 2 arrays inside data.js which looks like this-
I have another file test.js where I want to import data.js as module like this –
const data = require('./data.js')
and then access each array in this format-
data.girlsDataWeightAge[0]
data.boysDataWeightAge[0]
currently I am exporting each array like this –
export const NameOfArray= []
amd importing each array separately like this-
import {girlsDataWeightAge} from './data.js';
import {girlsDataWeightAge} from './data.js';
but I dont want to import them separately because I am going to pass the data through some functions and need to access it only the way I have specified above.