34 return e && o(t.prototype, e), n && o(t, n), t;
35 }
36 function a() {
37 return (a = 38 Object.assign ||
39 function (t) {
40 for (var e = 1; e < arguments.length; e++) {
JavaScript functions can be written as a declarations (function foo() { ... }
) or as a expressions (const foo = function() { ... };
).
While a JavaScript interpreter might tolerate it, overwriting/reassigning a function written as a declaration is often indicative of a mistake.
function foo() {}
foo = bar;
function foo() {
foo = bar;
}
let foo = function () {}
foo = bar;
function foo(foo) { // `foo` is shadowed.
foo = bar;
}
function foo() {
var foo = bar; // `foo` is shadowed.
}