Hi all :-)
I cannot find an answer to brackets followed by brackets like this:
This is used with node.js and socket.io
In my opinion there is no way to follow () by () ... but code works.
Maybe someone can explain, give a link or a tip to search for to learn backgrounds.
Thanks for your time :-)
It would mean that the expression
returns a function, and that returned function is then invoked by
thanks for reply :-)
is there a different way to write this ?
I cannot edit my post...
Is the reason a programmer does this, the timing of calling the function after binding ?
My guess, the reason behind the bind function passing back a function, instead of handing the entire operation itself, is because you could use the returning function multiple times afterwards.
So you would initially do the binding, but assign the resulting function to a variable:
Then when you want to use it elsewhere in the program:
var myConnection = this._config.connectionHandler.bind(this);
Now I understand - thanks interesting.
@bionood & Jeff Mott: Thank you
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread