Need to Iterate JSON object

Need to Iterate JSON object

I  have a JSON object:
users:[ 
user{
{      emailAddress "none"
  1. firstName"na"
  2. globalId"testus1"
  3. lastName"TestUS1"
  4. selectedDuties"User" },
    1. emailAddress"none"
    2. firstName"na"
    3. globalId"testus2"
    4. lastName"TestUS2"
    5. selectedDuties"User"
    }
  5. }
  6. ]

Im trying to do a check based on my global id. But im not able to... 

$.each(data.user,function(index,val){
for (var x=0; x < data.user.length;x++){ 
if ( data.user[x] == "globalId") { 
var actualData ={};
actualData.data=val;
jsObject.json_data.data.push(actualData);
}
}

Here data.user.length gives the value, where as if i check data.user[x] it gives undefined. 
Can any one please help me out to solve this...
Thanks in advance...