I have a function that can accept any number of arguments...
const getSearchFields = () => {
const joined = arguments.join(\'/\');
};
arguments
is a pseudo-array, not a real one. The join
method is available for arrays.
You'll need to cheat:
var convertedArray = [];
for(var i = 0; i < arguments.length; ++i)
{
convertedArray.push(arguments[i]);
}
var argsString = convertedArray.join('/');
Similar to other posts, you can do the following as shorthand:
var argsString = Array.prototype.join.call(arguments, "/");