Imagine a scenario where we have a grid with 5 columns and 3 rows as an example. However, the number of elements and their positions are unknown.
https://i.sstatic.net/Ay0i3.png
Consider that the only element on the grid is the red area. I am in need of a function with properties named row
and column
, representing the coordinates of the grid. If these are set to 1, 3
, the function should return false since there are no elements at those coordinates. But if we set them to 3, 4
, the function should return true. Essentially, I need this function to check if any element starts at the specified coordinates or covers the point within the grid. Is this feasible using pure JavaScript?