recursal/MDN huggingface dataset:
BluetoothRemoteGATTServer: getPrimaryServices() method
======================================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **BluetoothRemoteGATTServer.getPrimaryServices()** method returns a
 promise to a list of primary `BluetoothRemoteGATTService` objects offered by the
 Bluetooth device for a specified `BluetoothServiceUUID`.

Syntax
------


```js
getPrimaryServices(bluetoothServiceUUID)
```

### Parameters

`bluetoothServiceUUID`

A Bluetooth service universally unique identifier for a specified device.

### Return value

 A `Promise` that resolves to a list of `BluetoothRemoteGATTService`
 objects.

Specifications
--------------

| Specification |
| --- |
| Web Bluetooth # dom-bluetoothremotegattserver-getprimaryservices |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
BluetoothRemoteGATTServer: getPrimaryService() method
=====================================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`BluetoothRemoteGATTServer.getPrimaryService()`** method
 returns a promise to the primary `BluetoothRemoteGATTService` offered by the
 Bluetooth device for a specified bluetooth service UUID.

Syntax
------


```js
getPrimaryService(bluetoothServiceUUID)
```

### Parameters

`bluetoothServiceUUID`

A Bluetooth service universally unique identifier for a specified device, that is either a 128-bit UUID, a 16-bit or 32-bit UUID alias, or a string from the list of GATT assigned services keys.

### Return value

A `Promise` that resolves to a `BluetoothRemoteGATTService` object.

Specifications
--------------

| Specification |
| --- |
| Web Bluetooth # dom-bluetoothremotegattserver-getprimaryservice |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
BluetoothRemoteGATTServer: connected property
=============================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`BluetoothRemoteGATTServer.connected`** read-only
 property returns a boolean value that returns true while this script execution
 environment is connected to `this.device`. It can be false while the user
 agent is physically connected.

Value
-----

A `boolean`.

Specifications
--------------

| Specification |
| --- |
| Web Bluetooth # dom-bluetoothremotegattserver-connected |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
Comment: Comment() constructor
==============================

 The **`Comment()`** constructor returns a newly created
 `Comment` object with the optional string given in
 parameter as its textual content.

Syntax
------


```js
new Comment()
new Comment(aString)
```

### Parameters

* `aString` Optional
### Return value

A new `Comment` containing `aString`, or the empty string if no parameter was given.

Example
-------


```js
let comment = new Comment("Test");
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # ref-for-dom-comment-comment① |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The DOM interfaces index
* `Document.createComment()` is an outdated alternative to this constructor.
WebGLShaderPrecisionFormat: precision property
==============================================

The read-only **`WebGLShaderPrecisionFormat.precision`** property returns the number of bits of precision that can be represented.

For integer formats this value is always 0.

Examples
--------


```js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");

gl.getShaderPrecisionFormat(gl.VERTEX\_SHADER, gl.MEDIUM\_FLOAT).precision; // 23
gl.getShaderPrecisionFormat(gl.FRAGMENT\_SHADER, gl.LOW\_INT).precision; // 0
```

Specifications
--------------

| Specification |
| --- |
| WebGL Specification # DOM-WebGLShaderPrecisionFormat-precision |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLShaderPrecisionFormat`
* `WebGLRenderingContext.getShaderPrecisionFormat()`
WebGLShaderPrecisionFormat: rangeMin property
=============================================

The read-only **`WebGLShaderPrecisionFormat.rangeMin`** property returns the base 2 log of the absolute value of the minimum value that can be represented.

Examples
--------


```js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");

gl.getShaderPrecisionFormat(gl.VERTEX\_SHADER, gl.MEDIUM\_FLOAT).rangeMin; // 127
gl.getShaderPrecisionFormat(gl.FRAGMENT\_SHADER, gl.LOW\_INT).rangeMin; // 24
```

Specifications
--------------

| Specification |
| --- |
| WebGL Specification # DOM-WebGLShaderPrecisionFormat-rangeMin |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLShaderPrecisionFormat`
* `WebGLRenderingContext.getShaderPrecisionFormat()`
WebGLShaderPrecisionFormat: rangeMax property
=============================================

The read-only **`WebGLShaderPrecisionFormat.rangeMax`** property returns the base 2 log of the absolute value of the maximum value that can be represented.

Examples
--------


```js
const canvas = document.getElementById("canvas");
const gl = canvas.getContext("webgl");

gl.getShaderPrecisionFormat(gl.VERTEX\_SHADER, gl.MEDIUM\_FLOAT).rangeMax; // 127
gl.getShaderPrecisionFormat(gl.FRAGMENT\_SHADER, gl.LOW\_INT).rangeMax; // 24
```

Specifications
--------------

| Specification |
| --- |
| WebGL Specification # DOM-WebGLShaderPrecisionFormat-rangeMax |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLShaderPrecisionFormat`
* `WebGLRenderingContext.getShaderPrecisionFormat()`
NodeIterator: pointerBeforeReferenceNode property
=================================================

 The **`NodeIterator.pointerBeforeReferenceNode`** read-only
 property returns a boolean flag that indicates whether the
 `NodeFilter` is anchored before (if this value is `true`) or
 after (if this value is `false`) the anchor node indicated by the
 `NodeIterator.referenceNode` property.

Value
-----

A boolean.

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
flag = nodeIterator.pointerBeforeReferenceNode;
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-pointerbeforereferencenode |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface it belongs to: `NodeIterator`
NodeIterator: root property
===========================

 The **`NodeIterator.root`** read-only property represents the
 `Node` that is the root of what the `NodeIterator`
 traverses.

Value
-----

A `Node`.

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
root = nodeIterator.root; // document.body in this case
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-root |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface it belongs to: `NodeIterator`.
NodeIterator: detach() method
=============================

**Deprecated:** This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

 The **`NodeIterator.detach()`** method is a no-op, kept for
 backward compatibility only.

 Originally, it detached the `NodeIterator` from the set over which it
 iterates, releasing any resources used by the set and setting the iterator's state to
 `INVALID`. Once this method had been called, calls to other methods on
 `NodeIterator` would raise the `INVALID_STATE_ERR` exception.

Syntax
------


```js
detach()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
nodeIterator.detach(); // detaches the iterator

nodeIterator.nextNode(); // throws an INVALID\_STATE\_ERR exception
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-detach |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface it belongs to: `NodeIterator`.
NodeIterator: nextNode() method
===============================

 The **`NodeIterator.nextNode()`** method returns the next node
 in the set represented by the `NodeIterator` and advances the position of
 the iterator within the set. The first call to `nextNode()` returns the
 first node in the set.

This method returns `null` when there are no nodes left in the set.

 In old browsers, as specified in old versions of the specifications, the method may
 throws the `INVALID_STATE_ERR` `DOMException` if this method
 is called after the `NodeIterator.detach()`method. Recent browsers never
 throw.

Syntax
------


```js
nextNode()
```

### Parameters

None.

### Return value

A `Node` representing the node after the current node in the set represented by this `NodeIterator`, or `null` if the current node is the last node in the set.

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
currentNode = nodeIterator.nextNode(); // returns the next node
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-nextnode |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface it belongs to: `NodeIterator`.
NodeIterator: whatToShow property
=================================

 The **`NodeIterator.whatToShow`** read-only property represents
 an `unsigned integer` representing a bitmask signifying what types of nodes
 should be returned by the `NodeIterator`.

Value
-----

An `unsigned integer`.

The values that can be combined to form the bitmask are:

| Constant | Numerical value | Description |
| --- | --- | --- |
| `NodeFilter.SHOW_ALL` | `4294967295` (that is the max value of `unsigned long`) | Shows all nodes. |
| `NodeFilter.SHOW_ATTRIBUTE` 
Deprecated
 | `2` | 
 Shows attribute `Attr` nodes. This is meaningful
 only when creating a `NodeIterator` or
 `TreeWalker` with an
 `Attr` node as its root; in this case, it means
 that the attribute node will appear in the first position of the
 iteration or traversal. Since attributes are never children of other
 nodes, they do not appear when traversing over the document tree.
  |
| `NodeFilter.SHOW_CDATA_SECTION` 
Deprecated
 | `8` | Shows `CDATASection` nodes. |
| `NodeFilter.SHOW_COMMENT` | `128` | Shows `Comment` nodes. |
| `NodeFilter.SHOW_DOCUMENT` | `256` | Shows `Document` nodes. |
| `NodeFilter.SHOW_DOCUMENT_FRAGMENT` | `1024` | Shows `DocumentFragment` nodes. |
| `NodeFilter.SHOW_DOCUMENT_TYPE` | `512` | Shows `DocumentType` nodes. |
| `NodeFilter.SHOW_ELEMENT` | `1` | Shows `Element` nodes. |
| `NodeFilter.SHOW_ENTITY` 
Deprecated
 | `32` | Legacy, no more used. |
| `NodeFilter.SHOW_ENTITY_REFERENCE`

Deprecated
 | `16` | Legacy, no more used. |
| `NodeFilter.SHOW_NOTATION` 
Deprecated
 | `2048` | Legacy, no more used. |
| `NodeFilter.SHOW_PROCESSING_INSTRUCTION` | `64` | Shows `ProcessingInstruction` nodes. |
| `NodeFilter.SHOW_TEXT` | `4` | Shows `Text` nodes. |

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT | NodeFilter.SHOW\_COMMENT | NodeFilter.SHOW\_TEXT,
  { acceptNode: (node) => NodeFilter.FILTER\_ACCEPT },
);
if (
  nodeIterator.whatToShow & NodeFilter.SHOW\_ALL ||
  nodeIterator.whatToShow & NodeFilter.SHOW\_COMMENT
) {
  // nodeIterator will show comments
}
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-whattoshow |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface this property belongs to: `NodeIterator`.
NodeIterator: previousNode() method
===================================

 The **`NodeIterator.previousNode()`** method returns the
 previous node in the set represented by the `NodeIterator` and moves the
 position of the iterator backwards within the set.

 This method returns `null` when the current node is the first node in the
 set.

 In old browsers, as specified in old versions of the specifications, the method may
 throws the `INVALID_STATE_ERR` `DOMException` if this method
 is called after the `NodeIterator.detach()`method. Recent browsers never
 throw.

Syntax
------


```js
previousNode()
```

### Parameters

None.

### Return value

A `Node` representing the node before the current node in the set represented by this `NodeIterator`, or `null` if the current node is the first node in the set.

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
currentNode = nodeIterator.nextNode(); // returns the next node
previousNode = nodeIterator.previousNode(); // same result, since we backtracked to the previous node
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-previousnode |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface it belongs to: `NodeIterator`.
NodeIterator: referenceNode property
====================================

 The **`NodeIterator.referenceNode`** read-only property returns the
 `Node` to which the iterator is anchored; as new nodes are inserted, the
 iterator remains anchored to the reference node as specified by this property.

Value
-----

A `Node`.

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
node = nodeIterator.referenceNode;
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-referencenode |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface it belongs to: `NodeIterator`
NodeIterator: filter property
=============================

 The **`NodeIterator.filter`** read-only property returns a
 `NodeFilter` object, that is an object which implements an
 `acceptNode(node)` method, used to screen nodes.

 When creating the `NodeIterator`, the filter object is passed in as the
 third parameter, and the object method `acceptNode(node)` is
 called on every single node to determine whether or not to accept it. This function
 should return the constant `NodeFilter.FILTER_ACCEPT` for cases when the
 node should be accepted and `NodeFilter.FILTER_REJECT` for cases when the
 node should be rejected.

Value
-----

A `NodeFilter` object.

Examples
--------


```js
const nodeIterator = document.createNodeIterator(
  document.body,
  NodeFilter.SHOW\_ELEMENT,
  {
    acceptNode(node) {
      return NodeFilter.FILTER\_ACCEPT;
    },
  },
);
nodeFilter = nodeIterator.filter;
```

Specifications
--------------

| Specification |
| --- |
| DOM Standard # dom-nodeiterator-filter |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* The interface this property belongs to: `NodeIterator`.
Crypto: randomUUID() method
===========================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The **`randomUUID()`** method of the `Crypto` interface is used to generate a v4 UUID using a cryptographically secure random number generator.

Syntax
------


```js
randomUUID()
```

### Parameters

None.

### Return value

A string containing a randomly generated, 36 character long v4 UUID.

Examples
--------

The method is accessed through the global `crypto` property.


```js
/\* Assuming that self.crypto.randomUUID() is available \*/

let uuid = self.crypto.randomUUID();
console.log(uuid); // for example "36b8f84d-df4e-4d49-b662-bcde71a8764f"
```

Specifications
--------------

| Specification |
| --- |
| Web Cryptography API # Crypto-method-randomUUID |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Web Crypto API`
* `crypto` to get a `Crypto` object.
* `Crypto.getRandomValues`, a source for arbitrary amounts of secure random bytes.
Crypto: getRandomValues() method
================================

 The **`Crypto.getRandomValues()`** method lets you get cryptographically strong random values.
 The array given as the parameter is filled with random numbers (random in its cryptographic meaning).

 To guarantee enough performance, implementations are not using a truly random number generator, but they are using a pseudo-random number generator *seeded* with a value with enough entropy.
 The pseudo-random number generator algorithm (PRNG) may vary across user agents, but is suitable for cryptographic purposes.

`getRandomValues()` is the only member of the `Crypto` interface which can be used from an insecure context.

Syntax
------


```js
getRandomValues(typedArray)
```

### Parameters

`typedArray`

 An integer-based `TypedArray`, that is one of: `Int8Array`, `Uint8Array`,
 `Uint8ClampedArray`, `Int16Array`, `Uint16Array`,
 `Int32Array`, `Uint32Array`, `BigInt64Array`,
 `BigUint64Array` (but **not** `Float32Array` nor `Float64Array`).
 All elements in the array will be overwritten with random numbers.


### Return value

 The same array passed as `typedArray` but with its contents replaced with the newly generated random numbers.
 Note that `typedArray` is modified in-place, and no copy is made.

### Exceptions

`QuotaExceededError` `DOMException`

Thrown if the `byteLength` of `typedArray` exceeds 65,536.

Usage notes
-----------

 Don't use `getRandomValues()` to generate encryption keys.
 Instead, use the `generateKey()` method.
 There are a few reasons for this; for example, `getRandomValues()` is not guaranteed to be running in a secure context.

 There is no minimum degree of entropy mandated by the Web Cryptography specification.
 User agents are instead urged to provide the best entropy they can when generating random numbers,
 using a well-defined, efficient pseudorandom number generator built into the user agent itself,
 but seeded with values taken from an external source of pseudorandom numbers, such as a platform-specific random number function,
 the Unix `/dev/urandom` device, or other source of random or pseudorandom data.

Examples
--------


```js
const array = new Uint32Array(10);
self.crypto.getRandomValues(array);

console.log("Your lucky numbers:");
for (const num of array) {
  console.log(num);
}
```

Specifications
--------------

| Specification |
| --- |
| Web Cryptography API # Crypto-method-getRandomValues |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* Web Crypto API
* `crypto` to get a `Crypto` object.
* `Math.random`, a non-cryptographic source of random numbers.
Crypto: subtle property
=======================

**Secure context:** This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

 The **`Crypto.subtle`** read-only property returns a
 `SubtleCrypto` which can then be used to perform low-level
 cryptographic operations.

Value
-----

 A `SubtleCrypto` object you can use to interact with the Web Crypto API's
 low-level cryptography features.

Specifications
--------------

| Specification |
| --- |
| Web Cryptography API # Crypto-attribute-subtle |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `Crypto`.
* `SubtleCrypto`.
* Compatibility test page.
* Shim for IE11 and Safari.
TaskAttributionTiming: containerId property
===========================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`containerId`** readonly property of the `TaskAttributionTiming` interface returns the container's `id`
 attribute. A container is the iframe, embed or object etc. that is being implicated, on the whole, for a long task.

Value
-----

A string containing the container's `id` HTML content attribute.

Specifications
--------------

| Specification |
| --- |
| Long Tasks API # dom-taskattributiontiming-containerid |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
TaskAttributionTiming: containerSrc property
============================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`containerSrc`** readonly property of the `TaskAttributionTiming` interface returns the container's `src`
 attribute. A container is the iframe, embed or object etc. that is being implicated, on the whole, for a long task.

Value
-----

A string containing the container's `src` attribute (e.g. `<iframe src="url.html"`).

Specifications
--------------

| Specification |
| --- |
| Long Tasks API # dom-taskattributiontiming-containersrc |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.
TaskAttributionTiming: containerName property
=============================================

**Experimental:** **This is an experimental technology**  
Check the Browser compatibility table carefully before using this in production.

 The **`containerName`** readonly property of the `TaskAttributionTiming` interface returns the container's `name`
 attribute. A container is the iframe, embed or object etc. that is being implicated, on the whole, for a long task.

Value
-----

A string containing the container's `name` HTML content attribute (e.g. `<iframe name="myIframe"` or `<object name="myObject"`).

Specifications
--------------

| Specification |
| --- |
| Long Tasks API # dom-taskattributiontiming-containername |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.