Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY CYBERSECURITY DATA SCIENCE
     ❯   

Node.js buffer keys() Method

❮ Buffer Module


Example

Display the keys (indexes) of a Buffer object:

var buf = Buffer.from('abc');

for (x of buf.keys()) {
  console.log(x);
}
Run example »

Definition and Usage

The keys() method returns an iterator object, containing the key of each byte in a buffer object.


Syntax

buffer.keys();

Technical Details

Return Value: An Iterator object, containing the keys of a buffer
Node.js Version: 1.1.0

❮ Buffer Module