8
rated 0 times
[
15]
[
7]
/ answers: 1 / hits: 13412
/ 10 Years ago, tue, march 4, 2014, 12:00:00
In js code I have seen this used:
function doStuff( selector ) {
/* Stuff to do with selector */
}
var q = function( selector ) {
return new doStuff( selector );
}
What exactly is happening? What is return new
really doing? It seems to pass its arguments to the other function, but would someone please be kind enough to walk me through the process?
All and any help is appreciated, thanks in advance.
More From » function