Sets a value in an object, allowing for dot notation to control the depth of the property.
For example:
var data = { world: { position: { x: 200, y: 100 } }};SetValue(data, 'world.position.y', 300);console.log(data.world.position.y); // 300 Copy
var data = { world: { position: { x: 200, y: 100 } }};SetValue(data, 'world.position.y', 300);console.log(data.world.position.y); // 300
The object to set the value in.
The name of the property in the object. If a property is nested, the names of its preceding properties should be separated by a dot (.)
.
The value to set into the property, if found in the source object.
Sets a value in an object, allowing for dot notation to control the depth of the property.
For example: