Last Updated: February 25, 2016
·
2.007K
· vasman

Optional callback in javascript

/** @param [callback] function, optional */
function foo(callback) {
    typeof callback == 'function' && callback();
}