私はこのコードを変換したい:匿名矢印関数にアロー機能「という表現予想」構文エラー
var formatQuoteAmount = function (tx) {
return Currency.toSmallestSubunit(tx.usd, 'USD');
};
var quoteAmounts = res.transactions.map(formatQuoteAmount);
。私はこれを書いている:
var quoteAmounts = res.transactions.map(tx => Currency.toSmallestSubunit(tx.usd, 'USD'));
私は矢印でexpression expected
構文エラーを取得します。私はthe default syntax hereを見て、私のコードの構文が正しいと思われます。どのような問題が起こっているのでしょうか?
var quoteAmounts = res.transactions.map(function (tx) {
return Currency.toSmallestSubunit(tx.usd, 'USD')
});
が、私は矢機能と、それをワンライナーを作りたい:
私はそれがこの構文で働いています。 node v5.3.0
コンソールのログ出力(console.log(res.transactions); – Jai
)あなたはどの環境で実行していますか? 'node.js'の@nilsの – nils
です。私はOPタグを更新しました。 – Milkncookiez