Blob.prototype.slice

Returns a new blob containing the data in the specified range of bytes of the blob.

Syntax

slice(start?, end?, type?)

Parameters

Return value

A new Blob object.

Example

let blob = new Blob(['Hello, world!'])
blob.slice(0, 5).textSync()
"Hello"