On this page

    M

    worker_threads.isMarkedAsUntransferable

    History
    worker_threads.isMarkedAsUntransferable(object): boolean
    Attributes
    object:any
    Any JavaScript value.
    Returns:boolean

    Check if an object is marked as not transferable with markAsUntransferable().

    import { markAsUntransferable, isMarkedAsUntransferable } from 'node:worker_threads';
    
    const pooledBuffer = new ArrayBuffer(8);
    markAsUntransferable(pooledBuffer);
    
    isMarkedAsUntransferable(pooledBuffer);  // Returns true.
    const { markAsUntransferable, isMarkedAsUntransferable } = require('node:worker_threads');
    
    const pooledBuffer = new ArrayBuffer(8);
    markAsUntransferable(pooledBuffer);
    
    isMarkedAsUntransferable(pooledBuffer);  // Returns true.

    There is no equivalent to this API in browsers.