<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/database](./database.md) &gt; [DataSnapshot](./database.datasnapshot.md) &gt; [exportVal](./database.datasnapshot.exportval.md)

## DataSnapshot.exportVal() method

Exports the entire contents of the DataSnapshot as a JavaScript object.

The `exportVal()` method is similar to `val()`<!-- -->, except priority information is included (if available), making it suitable for backing up your data.

<b>Signature:</b>

```typescript
exportVal(): any;
```
<b>Returns:</b>

any

The DataSnapshot's contents as a JavaScript value (Object, Array, string, number, boolean, or `null`<!-- -->).

