I have gotten the answer I needed for my initial question but now I have another issue with the same array, I am using the getItem and setItem method to only display the iziToast popup once and after it has displayed once not display again (as I have the following array in a function that is within a setInterval function that runs every 30 seconds so essentially every 30 seconds the iziToast popup keeps popping up which I don't want it to do).
Here is the array:
var alerted = localStorage.getItem('alerted') || '';
for(var i in result) {
console.log(result[i].id);
if (alerted != result[i].id) {
$('#chatAudio')[0].play();
iziToast.show({
message: result[i].notification_text,
messageColor: '#424242',
backgroundColor: '#fff',
theme: 'light',
animateInside: true,
layout: 1,
close: false,
position: 'bottomLeft',
timeout: 5000,
progressBar: false
});
localStorage.setItem('alerted', result[i].id);
}
}