remove
Description
Removes a value from an object using a key.
Input / Parameter
Name | Description | Input Type | Default | Options | Required |
---|---|---|---|---|---|
data | The reference object to be updated. | Object | - | - | Yes |
attribute | The key of the value to be removed from the object. | Text | - | - | Yes |
Output
Description | Output Type |
---|---|
Returns the updated object. | Object |
Example
In this example, we will remove a key from an object and print the updated object in the console.
Step
Drag a
button
component into the canvas and open theAction
tab. Select thepress
event of the button and drag theLog.write
function to the event flow.Call the function
Object.remove
inside theLog.write
function.Then call the function
Conversion.toObject
inside thedata
parameter of theObject.remove
function.Sample parameters are shown in the picture below.
Result
The console will print the updated object.
For this example, the printed value will be
{name: 'John'}
.
Links
Related Information
See also:
Functions
Last updated