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

A 2-byte buffer holds [0x12, 0x34]. What do the big-endian and little-endian 16-bit reads return?

const buf = Buffer.from([0x12, 0x34]); console.log(buf.readUInt16BE(0).toString(16)); console.log(buf.readUInt16LE(0).toString(16));