'How to access a constraint by its label in matter-js?

I am currently building a game with react native game engine and matter-js. I want to be able to access the constraint by its label. I currently created it:

let constraint = Constraint.create({
  label: "Rope",
  pointA: { x: 200, y: 0 },
  bodyB: initialBall,
});

The documentation provides examples on how to give a constraint a label but not how to access it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source