console.log("message", arguments)
calls log with two arguments, a "message" and array type arguments.
console.log.apply( console, arguments );
calls it with arguments n , where n is the length of the arguments of an array type object. In other words, the arguments are expanded into separate arguments. Method Context: console . For example:.
function foo(a, b, c) { console.log.apply( console, arguments ); } foo(1,2,3);
approximately equivalent:
console.log(1,2,3);
Matthew Flaschen Jan 09 2018-11-11T00: 00Z
source share