Description of the problem:
My experiment requires presenting different images in different trials. All the images were already saved in a folder under resources. This is a piece of code I wrote in python to read all the files in the folder.
I am struggling to find a javascript code that can read all the files in a folder. I am wondering if anyone has the same issue.
Thank you.
from os import listdir
imagePatchDestination='./topSe/'
allImagePatches = [f for f in listdir(imagePatchDestination) if f.startswith('croppedImage_sceneNum_')]
# set an image by default
whichCroppedImageA=imagePatchDestination + allImagePatches[0]
whichCroppedImageB=imagePatchDestination + allImagePatches[0]
Stella