Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/ext/node/polyfills/buffer.ts>Buffer#keys

A modern runtime for JavaScript and TypeScript.
Go to Latest
method Buffer.prototype.keys
import { Buffer } from "https://deno.land/x/deno@v1.39.0/ext/node/polyfills/buffer.ts";

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

import { Buffer } from "ext:deno_node/internal/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>