Reputation: 8955
In a google apps script function, I have a Folder
parameter. So, this statement
Logger.log(typeof folder);
logs 'undefined' when the parameter is not supplied, which is right. But when a folder is supplied, I get this error:
Invalid JavaScript value of type $Proxy686. (line 15)
Not able to diagnose why. Need some help. Thanks.
Sanjay
Update: Here is the code reproducing the issue:
function typeOfTest() {
var folders = DocsList.getAllFolders();
for (var i = 0; i < folders.length; i++)
Logger.log(typeof folders[i]);
};
Upvotes: 0
Views: 1262
Reputation: 8660
In fact. I have the same behavior. I don't know either it is a bug or a feature. A possible workaround is to use the Folder's toString()
function. Something like
function typeOfTest() {
var folders = DocsList.getAllFolders();
for (var i = 0; i < folders.length; i++)
Logger.log(folders[i].toString());
};
Upvotes: 1