buf.entries()详解

buf.entries()

  • 返回:{Iterator}
从当前 Buffer 的内容中,创建并返回一个 [index, byte] 形式的迭代器。 ``` const buf = Buffer.from('buffer'); for (var pair of buf.entries()) { console.log(pair); } // prints: // [0, 98] // [1, 117] // [2, 102] // [3, 102] // [4, 101] // [5, 114] ```
原文地址:https://www.cnblogs.com/lalalagq/p/9908621.html