-
The one-liner code that concatenates all strings passed into a function is
-
- function concatenate()
{
return String.concat.apply('', arguments);
} - function concatenate()
{
return String.prototype.concat('', arguments);
} - function concatenate()
{
return String.prototype.concat.apply('', arguments);
} - function concatenate()
{
return String.prototype.apply('', arguments);
} - None of these
- function concatenate()
Correct Option: A
The concat() method is used to merge two or more arrays. This method does not change the existing arrays, but instead returns a new array. apply takes an array of arguments and treats each element of that array as a single argument.