0

I am attempting to store an Object into a variable after parsing a csv file. But the array is coming back empty after assigning it to the variable.

 var keywordsArray = []
    
CSVToJSON().fromFile('./csv/Campaign.csv')
    .then(campaigns => {
        // users is a JSON array
        // log the JSON array
         keywordsArray = campaigns
        
    }).catch(err => {
        // log error if any
        console.log(err);
    });

    console.log(keywordsArray);
Patrick Bentley
  • 462
  • 1
  • 5
  • 17

0 Answers0