Answers for "how to get an array from another script in js"

1

how to get an array from another script in js

// SCRIPT WHERE THE ARRAY IS
var yourArray;
export{yourArray/*, OtherThingsYouWannaExport*/}

// SCRIPT WHERE WE NEED THE ARRAY
import * as chooseName from './TheNameOfYourScriptFile.js'
chooseName.yourArray; // You can now access the array
Posted by: Guest on December-05-2020

Code answers related to "how to get an array from another script in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language