Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSBuffer for binary dataSingle-choice MCQ

What does Buffer.concat([a, b], totalLength) do when totalLength is smaller than the combined length of the buffers?

const x = Buffer.from([1, 2, 3]); const y = Buffer.from([4, 5, 6]); const z = Buffer.concat([x, y], 4); console.log(z.length, [...z]);