var obj ={ x:100, y:200, z:300 } for(key in obj){ if(obj.hasOwnProperty(key)){ console.log(key,obj[key]) } if(key == 'x'){ console.log(key,obj[key]) } }