Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardJavaScripttyped arrays and ArrayBufferSingle-choice MCQ

How does writing a fractional or out-of-range value into a Uint8ClampedArray differ from writing into a plain Uint8Array, at the conversion level?

const clamped = new Uint8ClampedArray(1); const plain = new Uint8Array(1); clamped[0] = 300; plain[0] = 300; const c2 = new Uint8ClampedArray(1); c2[0] = 2.5; console.log(clamped[0], plain[0], c2[0]);