graph-builder
Version:
A graph builder library for modeling abstract graph structures.
13 lines (8 loc) • 479 B
Markdown
[Home](./index) > [graph-builder](./graph-builder.md) > [BaseGraph](./graph-builder.basegraph.md) > [allowsSelfLoops](./graph-builder.basegraph.allowsselfloops.md)
# BaseGraph.allowsSelfLoops method
Returns true if this graph allows self-loops (edges that connect a node to itself). Attempting to add a self-loop to a graph that does not allow them will throw an error.
**Signature:**
```javascript
allowsSelfLoops(): boolean;
```
**Returns:** `boolean`