// The first element's total degree, in + out, answered in O(1) off the adjacency index
ele.degree(includeLoops?: boolean): number | undefinedThe first element's total degree, in + out, answered in O(1) off the adjacency index.
This is a singular accessor — it reports one node's degree, not a collection-wide figure. For the sum over the whole collection use totalDegree().
| Name | Description |
|---|---|
includeLoops: boolean?Default: true | whether self-loops count (each contributes 2) |
Returns
number | undefinedthe degree, or undefined when the first element is not a live node