call-function
Version:
Invoke function if is it callable and return result otherwise undefined
15 lines (13 loc) • 355 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var call = exports.call = function call() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var fn = args.shift();
if (typeof fn === 'function') {
return fn.apply(undefined, args);
}
};