Returns the reference count of a value.
Generally, the count returned is one higher than you might expect, because it includes the (temporary) reference.
Different nodes might return different reference values since the reference counter can be higher or lower depending on how the value is stored and used.
This function does not generate a change.
refs(value)
Argument | Type | Description |
---|---|---|
value | any (required) | The value to return the reference count for. |
Reference count of the given value.
Returns the reference count of a given value:
[
refs( 'some string' ),
refs( a = b = c = 42 ),
];
Example return value in JSON format
[
2,
5
]