toObject
Description
Creates an object using the key-value pairs provided or creates a new object.
Input / Parameter
Name | Description | Input Type | Default | Options | Required |
---|---|---|---|---|---|
{Dynamic} | {Based on user inputs.} | Any | - | - | No |
Note: Dynamic input means that user can add the necessary input required as key-value pairs.
Output
Description | Output Type |
---|---|
Returns the new object with the passed data. | Object |
Example
In this example, we will create an object and print the result in the console.
Step
Call the function
Conversion.toObject
inside theLog.write
function.Create the parameter(s) as required inside the
Conversion.toObject
and enter the value(s) for each parameter. In this example, we will create 2 parameters, 'name' and 'age' and enter the values {name: John, age: 27}.
Result
The console will print an object as depicted below.
Last updated