Constructs immutable bytes from supplied parts with optional type metadata.

Formal Syntax & Structure

javascript syntaxjavascript
new Blob(parts, options)

Parameters & Attributes

NameTypeDescription
partsarrayStrings, binary data or Blob parts.
optionsobjectOptional metadata and line-ending settings.

Return Value

Blob

Constructs immutable bytes from supplied parts with optional type metadata.

Working Example

Example Snippetjavascript
(async () => {const b=new Blob(["é"],{type:"text/plain"});console.log(b.size,b.type);})()
JavaScript Reference