# toObject

## Description

Creates an object of the passed data.

## Input / Parameter

| Name      | Description             | Input Type | Default | Options | Required |
| --------- | ----------------------- | ---------- | ------- | ------- | -------- |
| {Dynamic} | {Based on user inputs.} | Any        | -       | -       | No       |

Note: Dynamic input means that user can generate the necessary input required and assign a value in it as well.

## Output

| Description                                      | Output Type |
| ------------------------------------------------ | ----------- |
| Returns the created object with the passed data. | Object      |

## Callback

N/A

## Video

Coming soon.

## Example

The user wants to create an object data and view it in the console.

### Step

1. Call the function `console`. Call the function `toObject` inside the `value` parameter of the `console` function.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-de6fab6a3e6857356dadf8a4222de81d28826c44%2FtoObject-step-1.png?alt=media)
2. Add a key.\
   Key : name<br>

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-907f4d9efad9782bb55c67d65f3f925effe93645%2FtoObject-step-2.png?alt=media)
3. Assign a value to the key.\
   name : Lili

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-d419246817c8d36638b37cc622e66ea9d6eeb0b8%2FtoObject-step-3.png?alt=media)

### Result

![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-50c2605a9e61ec901a0d6faf184867b8cca06916%2FtoObject-result-1.png?alt=media)

## Links
