Home > @opennd/lib > getValueByPath
getValueByPath() function
使用字符串点操作获取对象中的值
Signature:
typescript
getValueByPath: (object: any, prop: string) => anyParameters
Parameter | Type | Description |
|---|---|---|
object | any | |
prop | string |
any
Example
getValueByPath(obj, 'a.b.c')