i am trying to read data from an excel file nd save it to a 2d array removing excess data but when i try to use the 2d arrays outside of the function it doesn't work
const xlsxFile = require('read-excel-file/node');
var x = 0
function excel() {
xlsxFile('./weather-data.xlsx').then((weather) => {
var weatherLen = weather.length
while ( x < weatherLen) {
if(weather[x][1] == null) {
delete weather[x]
}
x++
}
console.log(weather)
weather_data = weather
})
}
excel()