Skip to content

Tag: javascript

convert single array by two dimensional array by 6

I am trying to convert and merge my single array to two dimensional array. I use map for that but I can’t achieve the output I want. May I ask any suggestion on how to achieve this? The data is below: And now my expected output is: What I’ve done so far is https://jsfiddle.net/jc3v25bs/. I can dis…

Setting Socket.io room variables

I would like to store some information in the socket room variables, but am getting the following error: UnhandledPromiseRejectionWarning: TypeError: Cannot set property ‘host’ of undefined This is my code: If I try to log socket.roomId it would return something like rBAhx0. And when I log io.sock…