I used the void operator today in a case when I needed to call a function,
discard its return value and then return undefined. I did that mostly to be
able to omit curly braces in the one-line if statement (i personally think they
are ugly, especially when used in a very small constructions; python thing):
function sample(callback) {
// Do something
if (cond)
return void callback();
// Do something else
}
Now I am curious in other cases when void is useful (except for bookmarklets,
of course). Do you know any?
Anton
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]