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

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -