I'm trying to set the value of a named object key SORT with a function, like this:
statementPdfs.push ({
NAME: currFile.getName(),
ID: currFile.getId(),
BLOB: currFile.getBlob(),
MIME_TYPE: currFile.getBlob().getContentType(),
URL: currFile.getUrl(),
SORT: () => {
let dates = currFile.getName().match(/(\w+)\s(\d+)/);
return (dates[2]+
(dateNums[dates[1].toUpperCase()] < 10
? "0"+dateNums[dates[1].toUpperCase()]
: dateNums[dates[1].toUpperCase()]
)
);
}
});
...but the returned value for the SORT property is the function and not the return value. Sure there must be a simple answer, but it eludes me...