Websocket data push problem, how to compare the differences between the two push results

the background pushes to the front end via WS, similar to [{val="1",...}, {val="2",...},...] For such a piece of data, how does the front end compare the difference between the two pushed data, and locate which attribute value of the specific object has become larger or smaller, for example: the value of the object listed above? it is better to save the result of the last push in that way. I hope you can answer it if you understand it. Thank you!

Apr.19,2022

you can define a variable globally to store the data pushed by ws. Pseudocode:

var global = null
ws.on('event', function (data) {
    if (!global) {
        //  global data
    } 
    // 
    global = data
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf5bb5-31fb8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf5bb5-31fb8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?