Typically, when you want to include a JavaScript script from a subfolder, you would use:
<script src=foldername/filename.js></script>
Now, I have a specific local folder named jsfiles
which is located at the same level as the main script that calls it. Inside this folder, there are multiple JavaScript files with unknown names, each containing an array defined in JSON format.
All these files follow this pattern: var json = [{...},{...}]
My question is how can I write a for loop to extract EACH JSON object from EVERY file in the jsfiles
folder and push them into an array, even though I don't know the exact filenames?
Would I need to use a different programming language other than JavaScript for this task?
Thank you for your help in advance.