Web APIs
Blob.prototype.slice()
Creates a new Blob for a byte interval; end is exclusive.
Formal Syntax & Structure
javascript syntaxjavascript
blob.slice(start, end, contentType)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| start | number | Start byte position. |
| end | number | Exclusive end byte position. |
| contentType | string | Media type for result. |
Return Value
Blob
Creates a new Blob for a byte interval; end is exclusive.
Working Example
Example Snippetjavascript
(async () => {const b=new Blob(["abcd"]);console.log(await b.slice(1,3).text());})()