I tried to put this code into a function, however this gives an error that I can't fix. How can I rewrite the code so I can put it in a function?
Code:
var code = (await Notification.allPending()).filter((n) => n.threadIdentifier === scriptName);
SyntaxError: Unexpected identifier 'Notification'. Expected ')' to end a compound expression.
Thank you for every help!