Discord.js Bot to monitor streamers

var changed = false
var last_object = {stuff:'',thing:''}

var new_object = {stuff:''.thing:''}

for (var key in new_object) {
    if (last_object.hasOwnProperty(key)) {
        if (last_object[key] != new_object[key]) {
            // a key has changed
            changed = true;
        }
    } else {
        // a key was added
        changed = true;
    }
}

You’d probably only be testing the game/gameID or title for a discord bots live status, so rather than iterate all keys you’d test specific keys

Will account for new_object getting new keys but not new_object losing keys.

Or the last method

if (JSON.stringify(last_object) != JSON.stringify(new_object)) 

Assuming keys in the same order always.