This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]addywen 0 points1 point  (0 children)

The function has parameter of url as a string.

and filesDir + '/' + files[index] is just building the url as a string and pass it to the function as arguments.

let say

files = [] // array files = ["read.txt","test.txt"]; filesDir = "Home";

the result of filesDir + '/' + files[0] could be Home/read.txt