compare
BufferConstructor.compare
**compare**(buf1, buf2):
0\|
1\|
-1``
Compares buf1
to buf2
, typically for the purpose of sorting arrays ofBuffer
instances. This is equivalent to calling buf1.compare(buf2)
.
Parameters
buf1
Uint8ArrayRequiredbuf2
Uint8ArrayRequiredReturns
0
| 1
| -1
`0` \| `1` \| `-1`
0 | 1 | -1Either
-1
, 0
, or 1
, depending on the result of the comparison. See compare
for details.Since
v0.11.13
Was this section helpful?