TGViewer
JavaScript JavaScript @javascript · 31.1K subscribers
Post #3055 2.82K
CHALLENGE


const transactions = [
{ id: 1, type: "credit", amount: 200 },
{ id: 2, type: "debit", amount: 50 },
{ id: 3, type: "credit", amount: 150 },
{ id: 4, type: "debit", amount: 30 },
{ id: 5, type: "credit", amount: 100 },
];

const result = transactions
.filter(tx => tx.type === "credit")
.map(tx => ({ ...tx, amount: tx.amount * 1.1 }))
.reduce((acc, tx) => acc + tx.amount, 0);

console.log(result.toFixed(2));
  • 🔥 4
More from @javascript
  1. Sep 24, 2026Post #3516
  2. Sep 24, 2026CHALLENGE class Base { static count = 0; static increment() { this.count++; return this.co…
  3. Sep 23, 2026🤩 tinyjs: Build JavaScript Desktop Apps in <10MB I built an app with this and was impress…
  4. Sep 23, 2026Post #3513
  5. Sep 23, 2026CHALLENGE function* inner() { yield 1; yield 2; return 100; } function* outer() { const re…
  6. Sep 22, 2026Post #3511
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →