Project: /docs/reference/js/_project.yaml
Book: /docs/reference/_book.yaml
page_type: reference
{% comment %}
DO NOT EDIT THIS FILE!
This is generated by the JS SDK team, and any local changes will be
overwritten. Changes should be made in the source code at
https://github.com/firebase/firebase-js-sdk
{% endcomment %}
# VectorValue class
Represents a vector type in Firestore documents. Create an instance with [vector()](./firestore_.md#vector_0dbdaf2).
Signature:
```typescript
export declare class VectorValue
```
## Methods
| Method | Modifiers | Description |
| --- | --- | --- |
| [fromJSON(json)](./firestore_.vectorvalue.md#vectorvaluefromjson) | static | Builds a VectorValue instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson). |
| [isEqual(other)](./firestore_.vectorvalue.md#vectorvalueisequal) | | Returns true if the two VectorValue values have the same raw number arrays, returns false otherwise. |
| [toArray()](./firestore_.vectorvalue.md#vectorvaluetoarray) | | Returns a copy of the raw number array form of the vector. |
| [toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson) | | Returns a JSON-serializable representation of this VectorValue instance. |
## VectorValue.fromJSON()
Builds a `VectorValue` instance from a JSON object created by [VectorValue.toJSON()](./firestore_.vectorvalue.md#vectorvaluetojson).
Signature:
```typescript
static fromJSON(json: object): VectorValue;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| json | object | a JSON object represention of a VectorValue instance. |
Returns:
[VectorValue](./firestore_.vectorvalue.md#vectorvalue_class)
an instance of [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) if the JSON object could be parsed. Throws a [FirestoreError](./firestore_.firestoreerror.md#firestoreerror_class) if an error occurs.
## VectorValue.isEqual()
Returns `true` if the two `VectorValue` values have the same raw number arrays, returns `false` otherwise.
Signature:
```typescript
isEqual(other: VectorValue): boolean;
```
#### Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| other | [VectorValue](./firestore_.vectorvalue.md#vectorvalue_class) | |
Returns:
boolean
## VectorValue.toArray()
Returns a copy of the raw number array form of the vector.
Signature:
```typescript
toArray(): number[];
```
Returns:
number\[\]
## VectorValue.toJSON()
Returns a JSON-serializable representation of this `VectorValue` instance.
Signature:
```typescript
toJSON(): object;
```
Returns:
object
a JSON representation of this object.