I am completely new to ECMA script and also JavaScript in general.
I'm trying to convert my code to work on an older version of ECMA script (I think).
The following code
Unit.prototype.getItems = function (...args) {
let item = this.getItem.apply(this, args), items = [];
if (item) {
do {
items.push(copyUnit(item));
} while (item.getNext());
}
return items;
};
Returns:
SyntaxError: missing formal parameter on the first line.
What does the ...args argument mean? What code can I replace it with to be compatible with the older version of ECMA script.