Arguments
Additional arguments can be passed in to the function from SurrealDB, and these are accessible as an array using the arguments object within the JavaScript function.
LET $val = "SurrealDB";
LET $words = ["awesome", "advanced", "cool"];
CREATE article SET summary = function($val, $words) {
const [val, words] = arguments;
return `${val} is ${words.join(', ')}`;
};