toObject

Description

Creates an object using the key-value pairs provided or creates a new object.

Input / Parameter

NameDescriptionInput TypeDefaultOptionsRequired

{Dynamic}

{Based on user inputs.}

Any

-

-

No

Note: Dynamic input means that user can add the necessary input required as key-value pairs.

Output

DescriptionOutput 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

  1. Call the function Conversion.toObject inside the Log.write function.

  2. 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

  1. The console will print an object as depicted below.

Last updated