11780 }
11781 function t(e, n, t) {
11782 function o(e) {
11783 var n = t.apply(this, arguments);11784 return !1 === n && (e.stopPropagation(), e.preventDefault()), n;
11785 }
11786 function a() {
10635 !M.dataType && M.target
10636 ? ((d = M.success || function () {}),
10637 h.push(function (e, t, r) {
10638 var a = arguments,10639 n = M.replaceTarget ? "replaceWith" : "html";
10640 q(M.target)
10641 [n](e)
10545 var e = this.prop.apply(this, arguments);
10546 return (e && e.jquery) || "string" == typeof e
10547 ? e
10548 : this.attr.apply(this, arguments);10549 }),
10550 (q.fn.ajaxSubmit = function (M, e, t, r) {
10551 if (!this.length)
10542 }
10543 (q.fn.attr2 = function () {
10544 if (!_) return this.attr.apply(this, arguments);
10545 var e = this.prop.apply(this, arguments);10546 return (e && e.jquery) || "string" == typeof e
10547 ? e
10548 : this.attr.apply(this, arguments);
10541 : window.opera && window.opera.postError && window.opera.postError(e));
10542 }
10543 (q.fn.attr2 = function () {
10544 if (!_) return this.attr.apply(this, arguments);10545 var e = this.prop.apply(this, arguments);
10546 return (e && e.jquery) || "string" == typeof e
10547 ? e
There are rest parameters in ES2015
. We can use that feature for variadic functions instead of the arguments
variable.
arguments
does not have methods of Array.prototype
, so it's a bit of an inconvenience.
function foo() {
console.log(arguments);
}
function foo(action) {
var args = Array.prototype.slice.call(arguments, 1);
action.apply(null, args);
}
function foo(action) {
var args = [].slice.call(arguments, 1);
action.apply(null, args);
}
function foo(...args) {
console.log(args);
}
function foo(action, ...args) {
action.apply(null, args); // or `action(...args)`, related to the `prefer-spread` rule.
}
// Note: the implicit arguments can be overwritten.
function foo(arguments) {
console.log(arguments); // This is the first argument.
}
function foo() {
var arguments = 0;
console.log(arguments); // This is a local variable.
}