Skip to content

Instantly share code, notes, and snippets.

@sohel-rana
Last active December 10, 2015 05:08
Show Gist options
  • Save sohel-rana/4385764 to your computer and use it in GitHub Desktop.
Save sohel-rana/4385764 to your computer and use it in GitHub Desktop.
var list=Array();
list.push({id:1,name:'sohel'});
list.push({id:2,name:'kahled'});
list.push({id:3,name:'Rayan'});
list.push({id:4,name:'John'});
var exist=$.grep(list, function(obj) {
return obj.name === 'sohel';
});
if(exist.length===0){
//do something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment