Extract an exact key from object in Underscore.js -


i using underscore.js library. want extract exact key object.

var student = {sid : 101; sname: "abc"} 

i have tried this.

var key = _.findkey(student, 'sid'); 

but showing 'undefined' in key variable. me.

the _.findkey can used this:

_.findkey(student, function(x){ return x === 101});  // returns 'sid' 

Comments

Popular posts from this blog

java - Ebean enhancement ignores a model -

ubuntu - How to disable Kernel Module Signing in linux -

SQL php on different pages to Insert (mysqli) -