JS Built-ins
Blobbeginner

Blob.slice β€” slice(0,3) size

πŸ“– Usage Example
const b = new Blob(['Hello World'])
const part = b.slice(0, 5)
await part.text()  // β†’ 'Hello'

slice() returns a new Blob containing a portion of the original Blob's data.

Blob.slice() Method

blob.slice(start, end) returns a new Blob containing bytes from start (inclusive) to end (exclusive).

Challenge: Verify that new Blob(['hello']).slice(0, 3).size === 3.

πŸ’‘ Hints (1)
  • β€’ slice(start, end) β€” the end index is exclusive.