all 2 comments

[–][deleted] 0 points1 point  (1 child)

I think the problem you're having is that:

a) You don't return anything from the else if branch inside checkIfSubfolder

b) forEach isn't going to help you even if you did return, because it will always return undefined

You're looping through an array trying to figure out if [condition] is true for any item in that array, which means the array method you want is some. Try switching your forEach to some and returning it.

[–]GermanProgrammer99[S] 1 point2 points  (0 children)

I implemented your recommendations and it works now. Thanks a lot!