Static Methods
pick(obj, paths)pick.jsline 38
Retrieve a nested item from the given object/array.
PARAMETERS
Name Type Description obj
objectArray
Object for retrieving
paths
stringnumber
Paths of property
RETURNS:
{*
} - ValueEXAMPLES
// ES6 import pick from 'tui-code-snippet/object/pick'; // CommonJS const pick = require('tui-code-snippet/object/pick'); cosnt obj = { 'key1': 1, 'nested' : { 'key1': 11, 'nested': { 'key1': 21 } } }; pick(obj, 'nested', 'nested', 'key1'); // 21 pick(obj, 'nested', 'nested', 'key2'); // undefined const arr = ['a', 'b', 'c']; pick(arr, 1); // 'b'