Check how many events do x y coordinate

There are times when many events exist at the same time at the same location, how to check how many events at coordinate x y?
$gameMap.eventsXy(x, y) will give you an array of the events on that coordinate.
So, for example, $gameMap.eventsXy(5, 6).length will give the number of events on tile (5, 6).
Thanks for the elaboration, caethyril. 🙂
thanks everyone

Original thread: https://forums.rpgmakerweb.com/threads/check-how-many-events-do-x-y-coordinate.141837/