Node.js lodash findKey() find object by attribute

Description

Node.js lodash findKey() find object by attribute


var _ = require('lodash');

var object = { type: 'Circle' };

var key = _.findKey(object, function(val) { return val === 'Circle'}); 

console.log(key);/*from w w w .  ja  v  a  2s .c  o m*/



PreviousNext

Related