So here is my scenario — I am collecting a dynamic folder structure with javascript for a photoshop plugin I am developing. Here is what the folders may look like:
Folder 1
subFolder1
file1
file2
subFolder2
subsubfolder1
subsubfolder2
file1
file2
Folder 2
subFolder1
file1
file2
subFolder2
subsubfolder1
subsubfolder2
file1
file2
What would this syntax look like? tried to come up with it, but doesn’t look right to me. Also how would you loop through something like that? Do you for look on every sub array?
var multiArray = [ [Folder1, [subFolder1, [file1,file2],subFolder2, [subsubFolder1, subsubFolder2, [file1,file2] ], Folder2, [subFolder1, [file1,file2], subFolder2, [subsubfolder1,subsubfoler2, [file1,file2]
In your example:
subfolder would be ->
file would be ->
it really depends on what you want to achieve, but generally a combination of objects and arrays is best.
so you could have something like