I am looking to set up a global variable with a default value
const Months = [
{ name: 'January' },
{ name: 'February' },
{ name: 'March' },
{ name: 'April' },
{ name: 'May' },
{ name: 'June' },
{ name: 'July' },
{ name: 'August' },
{ name: 'September' },
{ name: 'October' },
{ name: 'November' },
{ name: 'December' }
];
and I want to be able to access the Months Variable in multiple files without having to declare it again.
In file1.tsx: Months.map(x => x.name);
In file2.tsx: Months.map(x => x.name);
What is the best way to achieve this?