JSFiddle - React, Tailwind, and code Playground
JavaScript
function sumArgs() {
return [].reduce.call(arguments, function(a, b) {
return a + b;
});
}
alert( sumArgs(4, 5, 6) ); // 6, аргументы переданы через запятую, без массива
function sumArgs() {
return [].reduce.call(arguments, function(a, b) {
return a + b;
});
}
alert( sumArgs(4, 5, 6) ); // 6, аргументы переданы через запятую, без массива