I stumbled upon code like this
if (options.callback)
{ options.callback; }
This can’t be right, correct? Options is some object with an attribute titled ‘callback’, now to execute callback it would require a options.callback(); Or is there some way to perform the callback if it is an object’s attribute somehow?
If the code above is correct, what should I add in the callback property to make it execute?
It must be a bug, since it doesn’t do anything useful.
The only way it could do anything was if
callbackwas a getter, but then it would be called twice and that doesn’t make any sense either.