I have a function that can accept any number of arguments...
const getSearchFields = () => { const joined = arguments.join(\'/\'); };
If you are using jQuery 1.2+, you can use $.makeArray():
Convert an array-like object into a true JavaScript array.
From the example in the question, just use this line
var args = $.makeArray(arguments);