Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSreadable vs writable streamsSingle-choice MCQ

A custom Writable has highWaterMark 4 and a write() that never calls its callback. What do the two write() calls return?

const { Writable } = require('stream'); const w = new Writable({ highWaterMark: 4, write(chunk, enc, cb) { /* cb never called */ } }); console.log(w.write(Buffer.alloc(2))); console.log(w.write(Buffer.alloc(3)));