how to check the contents of the array of doubles , if there is an array of [ 1,2,2,3,1 ] so the value you 've entered will not be entered again ?
function cek() {
resi_or_code = document.getElementById('code_or_resi').value;
resi = resi_or_code.split(',');
if($.trim(resi_or_code) != ''){
//location.href = base_url + 'resi/' + encodeURIComponent(resi_or_code);
}
if (localStorage.daftar_data){
daftar_data = JSON.parse(localStorage.getItem('daftar_data'));
$("#riwayat").toggle();
} else {
daftar_data = [];
}
for (x in resi){
console.log(localStorage.daftar_data);
daftar_data.push({'resis':resi[x]});
localStorage.setItem('daftar_data', JSON.stringify(daftar_data));
}
}