Preparing search index...

    Decodes binary data from a Uint8Array into a string using a specified character encoding.

        const decoder = new TextDecoder('utf-8');
    const bytes = new Uint8Array([72, 101, 108, 108, 111]);
    const text = decoder.decode(bytes);
    console.log('Decoded text:', text);

    const moreBytes = new Uint8Array([87, 111, 114, 108, 100]);
    const moreText = decoder.decode(moreBytes);
    console.log('Decoded more:', moreText);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    encoding: string

    The character encoding name used by this decoder, e.g. 'utf-8'.

    Methods

    • Decodes a Uint8Array into a string using the instance's encoding.

      Parameters

      • data: Uint8Array

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean