lodash clone deep code example
Example 1: lodash deep clone object
const clone = require('lodash/clone');
const cloneDeep = require('lodash/clonedeep');
const shallowCopy = clone(originalObject);
const deepCopy = clonedeep(originalObject);
Example 2: how to collect keys using lodash javascript
import * as _ from 'lodash';
const objectMap = {'key1': 'value1', 'key2': 'value2'};
const allKeys = _.keys(objectMap); //Returns a string[]. Here it will be ['key1','key2'];