Open this example in the interactive library
Source code
import { Buffer } from "node:buffer";
console.log(Buffer.from([1, 2]).readUInt16BE());
Sample output
258

Open this example in the interactive library
import { Buffer } from "node:buffer";
console.log(Buffer.from([1, 2]).readUInt16BE());
258