Home > @jsplumbtoolkit/core > data
data() function
Extract a value from, or set a value into, an object. This static method can be used outside of Knockle.
Signature:
export declare function data(inObj: Record<string, any>, path: string, value?: any): any;
Parameters
Parameter | Type | Description |
---|---|---|
inObj | Record<string, any> | Object to extract value from or insert value into |
path | string | Path to the value to extract/insert, in dotted notation. This syntax also supports array indices, such as foo.bar[3] . |
value | any | If provided, this method sets the value. Otherwise it extracts the current value. |
Returns:
any
Value for the given path, null if not found.