Skip to content Skip to sidebar Skip to footer

Remove A Square Bracket And Receiving JSON Properly In Nodejs/websocket Enviroment?

At the moment I can only output data of a specific key (index) with console.log(auction[index].id); but I need the data using console.log(auction.id);. How do I accomplish this? I'

Solution 1:

This is your problem:

    streamArray.push(fields);
    updateSockets({ streamArray: streamArray });

It does create the one-slot array that is superfluous. My guess is that you either wanted to move the streamArray.push(…) inside of the for loop (and then push fields[i] or something), or you just should do

 updateSockets({ streamArray: fields });

and omit all streamArray code.


Post a Comment for "Remove A Square Bracket And Receiving JSON Properly In Nodejs/websocket Enviroment?"