Skip to content

Instantly share code, notes, and snippets.

@wxingheng
Created March 13, 2019 09:02
Show Gist options
  • Select an option

  • Save wxingheng/2f26889c4562e62ae4487ff76009f001 to your computer and use it in GitHub Desktop.

Select an option

Save wxingheng/2f26889c4562e62ae4487ff76009f001 to your computer and use it in GitHub Desktop.
通用方法汇总 getV 方法 函数 手机通用方法
```language
/**
* getV(init, obj, 'children', 'children' ...)
* @param init args
* @returns {any}
*/
const getV = (init, ...args) => args.length >=2 ? args.reduce((a, b) => a && a.hasOwnProperty(b) ? a[b]: init) : init
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment