Module

std/node/buffer.ts>Buffer#keys

Deno standard library
Go to Latest
method Buffer.prototype.keys
import { Buffer } from "https://dotland.deno.dev/std@0.116.0/node/buffer.ts";

Creates and returns an iterator of buf keys (indices).

import { Buffer } from 'buffer';

const buf = Buffer.from('buffer');

for (const key of buf.keys()) {
  console.log(key);
}
// Prints:
//   0
//   1
//   2
//   3
//   4
//   5

Returns

IterableIterator<number>