Hey,
There's 2 ways for adding something to an array.
Let's say you made this array (for the sake of comprehension I used strings but you can use your custom resource type)
var inventory = ["Sword", "Shield", "Potion"]
You can add an item to a specific position
#insert an item after the "Shield" item, so at the 2d position
inventory.insert(2, "Apple")
#new inventory will be ["Sword", "Shield", "Apple", "Potion"]
Or you can simply add it to the end of the array
inventory.append("Apple")
#new inventory will be ["Sword", "Shield", "Potion", "Apple"]