I can't understand why it's always shows NOT equal in code :
if(JSON.stringify(data.content.items) != JSON.stringify(updatedItems)) {
console.log('update');
updatedItems = data.content.items; // updatedItems -global variable
}
I receive array of objects and check every second if it's equal or not.