buf.keys()


新增于: v1.1.0

创建并返回 迭代器buf 键(索引)。

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

import { Buffer } from 'node:buffer';
const buf = Buffer.from('buffer');
for (const key of buf.keys()) {
 console.log(key);
}
// Prints:
// 0
// 1
// 2
// 3
// 4
// 5const { Buffer } = require('node:buffer');
const buf = Buffer.from('buffer');
for (const key of buf.keys()) {
 console.log(key);
}
// Prints:
// 0
// 1
// 2
// 3
// 4
// 5

AltStyle によって変換されたページ (->オリジナル) /