JS Built-ins
Blobbeginner

Blob β€” size of 'hello'

πŸ“– Usage Example
const b = new Blob(['Hello, World!'])
b.size  // β†’ 13

Blob() creates an immutable file-like object from an array of strings or buffers.

Blob Constructor

new Blob(blobParts, options) creates a Blob from an array of strings, ArrayBuffers, or other Blobs.

new Blob(['hello']).size equals 5 because 'hello' has 5 UTF-8 bytes.

Challenge: Verify that new Blob(['hello']).size === 5.

πŸ’‘ Hints (1)
  • β€’ Blob.size reflects the number of UTF-8 bytes.