Using callback function in websocket api javascript

I’m trying to put a callback function like this im formatting the string like that because thats what needs for some reason var sendString = ’42’ + JSON.stringify([‘checkLogin’ , username, password]) socket.send(sendString, function(returnData){ console.log(returnData); resolve(returnData); }) but I keep getting an error that callback is not a function on my server-side using which…

JavaScript tag type in conditional expression if

I don’t understand why after click on the button, expression in if is True. I would expect that clicking on mentioned button doesn’t execute instruction under if: $(‘.table tbody tr’).click(function(event) { if ( !== ‘radio’ && !== ‘button’) { $(‘:radio’, this).trigger(‘click’); $(“tr”).removeClass(“curr_default”); $(this).addClass(“curr_default”); } }); <!– … –> <tbody> </tbody> </table>