I want to check if a key exist in an object and if exist return the value of the key.
var user_right=user_rights.split(',');
var tbar=new Array();
Ext.each(user_right,function(val,index){
if(items.hasOwnProperty(val))
-->tbar.push(items.val)
});
console.log(tbar);
But 'tbar.push(items.val)' is not working I'm sure that this is not the right method. How can retrieve value. Update : Unfortunately this is below code is not working too
if(items.hasOwnProperty(val)){}
Please help