Hi I am exploring Ml5js posenet model to get the 2D keypoints. I am using these keypoints to calculate the angle around a joint area , for example shoulder joint. I am looking for a way to store the x and y co .ordinates of associated key points when it full fills a certain condition.

For example in the following pseudo code if the angle range is between 85-95 degrees it should store

the first value of the shoulder co ordinates for example

```
let shoulderX,shoulderY // Global variables
draw()
{
if (angle >= 85 || angle <+ 95)
{
shoulderX = poses.keypoints[shoulder].x;
shoulderY = poses.keypoints[shoulder].y ;
}
}
```

With such a logic I do get a range of shoulderX , shoulderY values but I am looking to save only a snapshot of the value, that is the first value when the condition is fulfilled. Is there a way to achieve that ?