You can also put an array into the JavaScript program. You can also access the different parts by the parts of the array. You can do this by using the following code :
Code:
var secondLevelLocation = pathArray[0];
And if you want to put that pathname back together, you can do that by pasting together the array and put the “/”’s back in. Just look at the following code so you can understand it clearly :
Code:
var newPathname = "";
for ( i = 0; i pathArray.length; i++ ) {
newPathname += "/";
newPathname += pathArray[i];
}
Bookmarks