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

Optional callback in javascript

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