This should work:
...
var allitems = JSON.parse(localStorage["saved"]);
var repeated=allitems.filter(function(a){ return a.myitem==newitem}).length;
if(!repeated){
allitems.push({"myitem":newitem});
localStorage.setItem('saved', JSON.stringify(allitems));
}else{alert('already added')}
...