How do the two arrays print these out-of-range and fractional values?

from Typed arrays and ArrayBuffer
Node 24 intermediate 2 min

How do the two arrays print these out-of-range and fractional values?

JavaScript
const wrapped = new Uint8Array([256, -1, 3.9]);
const clamped = new Uint8ClampedArray([256, -1, 3.9]);

console.log([...wrapped].join(','));
console.log([...clamped].join(','));
Open in playground
Report an error