Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 231887

Re: Create a directory tree: How to call a global function from within a for loop

$
0
0

@BWinchell - the problem is not related to global functions or nested objects.

 

Look at the statements that assign a value of rootFolder variable

var rootFolder = ...;

 

In all these assignments (except the first one) you are assigning a string value to rootFolder variable, and later you are trying to invoke createFolder() method on this string object. Obviously, string type does not have such method, so the invocation fails with type error.

 

You need to ensure that assignments to rootFolder assign a valid folder value, like the solution provided by robrtb12 does.

 

Hope this helps,

-Ilian


Viewing all articles
Browse latest Browse all 231887

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>