Monday, 6 January 2020

20200107 - for-each in Google Script

Refer to <https://stackoverflow.com/questions/46693496/for-each-loop-in-google-apps-script>:

In Google Apps Script:
When using "for (var item in itemArray)",
'item' will be the indices of itemArray throughout the loop (0, 1, 2, 3, ...).

When using "for each (var item in itemArray)",
'item' will be the values of itemArray throughout the loop ('item0', 
'item1', 'item2', 'item3', ...).

No comments:

Post a Comment

Note: only a member of this blog may post a comment.