Arrow function “expression expected” syntax error
问题 I want to transform this code: var formatQuoteAmount = function (tx) { return Currency.toSmallestSubunit(tx.usd, 'USD'); }; var quoteAmounts = res.transactions.map(formatQuoteAmount); into an anonymous arrow function. I've written this: var quoteAmounts = res.transactions.map(tx => Currency.toSmallestSubunit(tx.usd, 'USD')); I get expression expected syntax error at the arrow. I looked up the default syntax here and seems like the syntax of my code is correct. Any ideas what the problem might