Skip to main content

$setObjectValue

This function sets a new value for a specified key in an object.

Parameters

ParameterDescription
objectThe object in which the key's value will be set.
keyThe key for which the value will be set.
newValueThe new value to be set for the specified key.

Example

<AoiClient>.addCommand({
name: "setValue",
code: `
$setObjectValue[{ "name": "John", "age": 25, "city": "New York" };age;30] // Replace the object with your own
`,
});