I started to use JS Promises in a project recently. I noticed that every time I use .catch
my JS linter complains. It does run and does what it should but I looked up the ECMAScript spec and it really looks like it is right: Since catch
is a keyword it can not be used as an identifier. As I understand method names are identifiers, so this is invalid:
Promise.reject("Duh").catch(alert);
It should be this instead:
Promise.reject("Duh")['catch'](alert);
What am I missing?