Getting layer properties from Tiled

I can’t believe how difficult a time I’m having understanding this…

In my scene I am trying to read a custom layer property from Tiled. I have no issue grabbing custom properties from individual tiles or objects in an object layer for example but the following code:

console.log(this.tileMap.getLayer(KEYS.TILEMAPS.LAYERS.FLOOR).properties.depth)

returns undefined

So, to try and figure out what was being held in properties, I used:

this.tileMap.getLayer(KEYS.TILEMAPS.LAYERS.FLOOR).properties.forEach((p) => { console.log(p); });

and got…

{name: "depth", type: "int", value: 0}

I know i’m having a brainfart but can someone please explain how I can access the custom layer property’s value as I’m tearing my hair out.

Never mind, brainfart over.

this.tileMap.getLayer(KEYS.TILEMAPS.LAYERS.FLOOR).properties[0].value

or alternatively, iterate over the array of custom properties to check properties[i].name and pair it to the properties[i].value if anyone is wondering