So I have this:
(function () {
// work
}).defer(1000);
For my admittedly weak understanding of javascript this executes an anonymous class after a second of wait time.
So I wanted to change it to something like this:
var newClass = function() {
// work
};
newClass().defer(1000);
But this doesn't give me the delay for some reason. I feel like these two code samples are exactly the same, I am wrong in this assumption?
Edit:
I'm using this defer method, sorry I thought it was a javascript thing.