Im am working with some code from another developer and came across something I have not seen before. The basic functionality of the code is to look for a piece of data in an object within an object. The object format is theObj {key:Object, key:Object,...}
, the data being searched for is stored in 2 variables inkey
,lookfor
.
$.each(theObj, function(m,n){
if(typeof(n['data'][inkey]) != "undefined" && n['data'][inkey] !== null) {
if(n['data'][inkey][lookfor] == 1){..}
}
});
What does the ['data']
do?