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 - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

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