recursal/MDN huggingface dataset:
DataView.prototype.setBigUint64()
=================================

The **`setBigUint64()`** method of `DataView` instances takes a BigInt and stores it as a 64-bit unsigned integer in the 8 bytes starting at the specified byte offset of this `DataView`. There is no alignment constraint; multi-byte values may be stored at any offset within bounds.

Try it
------

Syntax
------


```js
setBigUint64(byteOffset, value)
setBigUint64(byteOffset, value, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set as a `BigInt`. For how the value is encoded in bytes, see Value encoding and normalization.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is written.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setBigUint64()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setBigUint64(0, 3n);
dataview.getBigUint64(1); // 768n
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setbiguint64 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `BigUint64Array`
DataView.prototype.getFloat64()
===============================

The **`getFloat64()`** method of `DataView` instances reads 8 bytes starting at the specified byte offset of this `DataView` and interprets them as a 64-bit floating point number. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.

Try it
------

Syntax
------


```js
getFloat64(byteOffset)
getFloat64(byteOffset, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to read the data from.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is read.

### Return value

Any number value.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would read beyond the end of the view.

Examples
--------

### Using getFloat64()


```js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getFloat64(1)); // 8.20788039913184e-304
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.getfloat64 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Float64Array`
DataView.prototype.getFloat32()
===============================

The **`getFloat32()`** method of `DataView` instances reads 4 bytes starting at the specified byte offset of this `DataView` and interprets them as a 32-bit floating point number. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.

Try it
------

Syntax
------


```js
getFloat32(byteOffset)
getFloat32(byteOffset, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to read the data from.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is read.

### Return value

A floating point number from `-3.4e38` to `3.4e38`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would read beyond the end of the view.

Examples
--------

### Using getFloat32()


```js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getFloat32(1)); // 2.387939260590663e-38
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.getfloat32 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Float32Array`
DataView.prototype.setUint32()
==============================

The **`setUint32()`** method of `DataView` instances takes a number and stores it as a 32-bit unsigned integer in the 4 bytes starting at the specified byte offset of this `DataView`. There is no alignment constraint; multi-byte values may be stored at any offset within bounds.

Try it
------

Syntax
------


```js
setUint32(byteOffset, value)
setUint32(byteOffset, value, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set. For how the value is encoded in bytes, see Value encoding and normalization.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is written.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setUint32()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setUint32(0, 3);
dataview.getUint32(1); // 768
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setuint32 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Uint32Array`
DataView.prototype.setBigInt64()
================================

The **`setBigInt64()`** method of `DataView` instances takes a BigInt and stores it as a 64-bit signed integer in the 8 bytes starting at the specified byte offset of this `DataView`. There is no alignment constraint; multi-byte values may be stored at any offset within bounds.

Try it
------

Syntax
------


```js
setBigInt64(byteOffset, value)
setBigInt64(byteOffset, value, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set as a `BigInt`. For how the value is encoded in bytes, see Value encoding and normalization.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is written.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setBigInt64()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setBigInt64(0, 3n);
dataview.getBigInt64(1); // 768n
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setbigint64 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `BigInt64Array`
DataView.prototype.setInt32()
=============================

The **`setInt32()`** method of `DataView` instances takes a number and stores it as a 32-bit signed integer in the 4 bytes starting at the specified byte offset of this `DataView`. There is no alignment constraint; multi-byte values may be stored at any offset within bounds.

Try it
------

Syntax
------


```js
setInt32(byteOffset, value)
setInt32(byteOffset, value, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set. For how the value is encoded in bytes, see Value encoding and normalization.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is written.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setInt32()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setInt32(0, 3);
dataview.getInt32(1); // 768
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setint32 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Int32Array`
DataView.prototype.setFloat64()
===============================

The **`setFloat64()`** method of `DataView` instances takes a number and stores it as a 64-bit floating point number in the 8 bytes starting at the specified byte offset of this `DataView`. There is no alignment constraint; multi-byte values may be stored at any offset within bounds.

Try it
------

Syntax
------


```js
setFloat64(byteOffset, value)
setFloat64(byteOffset, value, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set. For how the value is encoded in bytes, see Value encoding and normalization.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is written.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setFloat64()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setFloat64(0, 3);
dataview.getFloat64(1); // 3.785766995733679e-270
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setfloat64 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Float64Array`
DataView.prototype.byteOffset
=============================

The **`byteOffset`** accessor property of `DataView` instances returns the offset (in bytes) of this view from the start of its `ArrayBuffer` or `SharedArrayBuffer`.

Try it
------

Description
-----------

The `byteOffset` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed.

Examples
--------

### Using the byteOffset property


```js
const buffer = new ArrayBuffer(8);
const dataview = new DataView(buffer);
dataview.byteOffset; // 0 (no offset specified)

const dataview2 = new DataView(buffer, 3);
dataview2.byteOffset; // 3 (as specified when constructing the DataView)
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-get-dataview.prototype.byteoffset |

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

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

See also
--------

* `DataView`
* `ArrayBuffer`
* `SharedArrayBuffer`
DataView.prototype.getInt16()
=============================

The **`getInt16()`** method of `DataView` instances reads 2 bytes starting at the specified byte offset of this `DataView` and interprets them as a 16-bit signed integer. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.

Try it
------

Syntax
------


```js
getInt16(byteOffset)
getInt16(byteOffset, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to read the data from.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is read.

### Return value

An integer from -32768 to 32767, inclusive.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would read beyond the end of the view.

Examples
--------

### Using getInt16()


```js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getInt16(1)); // 258
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.getint16 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Int16Array`
DataView() constructor
======================

The **`DataView()`** constructor creates `DataView` objects.

Try it
------

Syntax
------


```js
new DataView(buffer)
new DataView(buffer, byteOffset)
new DataView(buffer, byteOffset, byteLength)
```


**Note:** `DataView()` can only be constructed with `new`. Attempting to call it without `new` throws a `TypeError`.

### Parameters

`buffer`

 An existing `ArrayBuffer` or `SharedArrayBuffer` to use as
 the storage backing the new `DataView` object.


`byteOffset` Optional

 The offset, in bytes, to the first byte in the above buffer for the new view to
 reference. If unspecified, the buffer view starts with the first byte.


`byteLength` Optional

 The number of elements in the byte array. If unspecified, the view's length will
 match the buffer's length.


### Return value

A new `DataView` object representing the specified data buffer.

### Exceptions

`RangeError`

Thrown if the `byteOffset` or `byteLength` parameter values result in the view extending past the end of the buffer. In other words, `byteOffset + byteLength > buffer.byteLength`.

Examples
--------

### Using DataView


```js
const buffer = new ArrayBuffer(16);
const view = new DataView(buffer, 0);

view.setInt16(1, 42);
view.getInt16(1); // 42
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview-constructor |

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

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

See also
--------

* Polyfill of `DataView` in `core-js`
* `DataView`
DataView.prototype.setUint8()
=============================

The **`setUint8()`** method of `DataView` instances takes a number and stores it as an 8-bit unsigned integer in the byte at the specified byte offset of this `DataView`.

Try it
------

Syntax
------


```js
setUint8(byteOffset, value)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set. For how the value is encoded in bytes, see Value encoding and normalization.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setUint8()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setUint8(0, 3);
dataview.getUint8(0); // 3
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setuint8 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Uint8Array`
DataView.prototype.getUint32()
==============================

The **`getUint32()`** method of `DataView` instances reads 4 bytes starting at the specified byte offset of this `DataView` and interprets them as a 32-bit unsigned integer. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.

Try it
------

Syntax
------


```js
getUint32(byteOffset)
getUint32(byteOffset, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to read the data from.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is read.

### Return value

An integer from 0 to 4294967295, inclusive.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would read beyond the end of the view.

Examples
--------

### Using getUint32()


```js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getUint32(1)); // 16909060
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.getuint32 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Uint32Array`
DataView.prototype.byteLength
=============================

The **`byteLength`** accessor property of `DataView` instances returns the length (in bytes) of this view.

Try it
------

Description
-----------

The `byteLength` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when an `DataView` is constructed and cannot be changed. If the `DataView` is not specifying an offset or a `byteLength`, the `byteLength` of the referenced `ArrayBuffer` or `SharedArrayBuffer` will be returned.

Examples
--------

### Using the byteLength property


```js
const buffer = new ArrayBuffer(8);
const dataview = new DataView(buffer);
dataview.byteLength; // 8 (matches the byteLength of the buffer)

const dataview2 = new DataView(buffer, 1, 5);
dataview2.byteLength; // 5 (as specified when constructing the DataView)

const dataview3 = new DataView(buffer, 2);
dataview3.byteLength; // 6 (due to the offset of the constructed DataView)
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-get-dataview.prototype.bytelength |

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

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

See also
--------

* `DataView`
* `ArrayBuffer`
* `SharedArrayBuffer`
DataView.prototype.buffer
=========================

The **`buffer`** accessor property of `DataView` instances returns the `ArrayBuffer` or `SharedArrayBuffer` referenced by this view at construction time.

Try it
------

Description
-----------

The `buffer` property is an accessor property whose set accessor function is `undefined`, meaning that you can only read this property. The value is established when the `DataView` is constructed and cannot be changed.

Examples
--------

### Using the buffer property


```js
const buffer = new ArrayBuffer(8);
const dataview = new DataView(buffer);
dataview.buffer; // ArrayBuffer { byteLength: 8 }
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-get-dataview.prototype.buffer |

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

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

See also
--------

* `DataView`
* `ArrayBuffer`
* `SharedArrayBuffer`
DataView.prototype.setInt8()
============================

The **`setInt8()`** method of `DataView` instances takes a number and stores it as an 8-bit signed integer in the byte at the specified byte offset of this `DataView`.

Try it
------

Syntax
------


```js
setInt8(byteOffset, value)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to store the data in.

`value`

The value to set. For how the value is encoded in bytes, see Value encoding and normalization.

### Return value

`undefined`.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would store beyond the end of the view.

Examples
--------

### Using setInt8()


```js
const buffer = new ArrayBuffer(10);
const dataview = new DataView(buffer);
dataview.setInt8(0, 3);
dataview.getInt8(0); // 3
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.setint8 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Int8Array`
DataView.prototype.getInt8()
============================

The **`getInt8()`** method of `DataView` instances reads 1 byte at the specified byte offset of this `DataView` and interprets it as an 8-bit signed integer.

Try it
------

Syntax
------


```js
getInt8(byteOffset)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to read the data from.

### Return value

An integer from -128 to 127, inclusive.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would read beyond the end of the view.

Examples
--------

### Using getInt8()


```js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getInt8(1)); // 1
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.getint8 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `Int8Array`
DataView.prototype.getBigInt64()
================================

The **`getBigInt64()`** method of `DataView` instances reads 8 bytes starting at the specified byte offset of this `DataView` and interprets them as a 64-bit signed integer. There is no alignment constraint; multi-byte values may be fetched from any offset within bounds.

Try it
------

Syntax
------


```js
getBigInt64(byteOffset)
getBigInt64(byteOffset, littleEndian)
```

### Parameters

`byteOffset`

The offset, in bytes, from the start of the view to read the data from.

`littleEndian` Optional

Indicates whether the data is stored in little- or big-endian format. If `false` or `undefined`, a big-endian value is read.

### Return value

A `BigInt` from -263 to 263-1, inclusive.

### Exceptions

`RangeError`

Thrown if the `byteOffset` is set such that it would read beyond the end of the view.

Examples
--------

### Using getBigInt64()


```js
const { buffer } = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
const dataview = new DataView(buffer);
console.log(dataview.getBigInt64(1)); // 72623859790382856n
```

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

| Specification |
| --- |
| ECMAScript Language Specification # sec-dataview.prototype.getbigint64 |

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

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

See also
--------

* JavaScript typed arrays guide
* `DataView`
* `ArrayBuffer`
* `BigInt64Array`