Get 2D position of an array element

For my inventory I need to find free places in the 2d array:

Example; InvGrid (0 = null; n = item_n)

0 0 0 0 0 0 0 0

0 0 0 0 1 1 0 0

0 2 0 0 1 1 0 0

0 2 0 0 0 0 0 0

0 0 0 3 3 3 0 0

0 0 0 3 3 3 0 0

Now I want an item (item_4) to read out all free (0) positions to find a place it would fit in.

Whats the best way to get that? Thx

Well, I’ve tried with “var i = InvGrid[Item_4_PosX, Item_4_PosY];” with item_Pos < InvGrid.length.
Wont work…