how to get an array from another script in js

Solutions on MaxInterview for how to get an array from another script in js by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to get an array from another script in js"
Anissa
15 Feb 2017
1// SCRIPT WHERE THE ARRAY IS
2var yourArray;
3export{yourArray/*, OtherThingsYouWannaExport*/}
4
5// SCRIPT WHERE WE NEED THE ARRAY
6import * as chooseName from './TheNameOfYourScriptFile.js'
7chooseName.yourArray; // You can now access the array