Jump to content

How harmful is "GetNumItems"?


Recommended Posts

Yeah, I view the arrow as you're taking an item from the reference and storing it into a variable

 

For that example, that is an array foreach loop. The "item" is a stringmap array that contains the current index and the current value at that index of the array being processed, 'item["value"]' and 'item["key"]' respectively. Its a similar idea to inventory references, but instead of an inventory the container is now an array. The last type is for strings, where each item in the string container is a character. Thus after each loop, the 'item' variable is wiped out and refreshed with the next thing being processed

 

ForEach loops are quite powerful and once you learn how they work are super useful

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...