I like the tricks :) – Kasia
Using an object instead of passing positional arguments can help prevent subtle bugs.
const pay = (amount: number, discount: number) => {} pay(discount, amount) // ⛔️
const pay = ({ amount, discount }: { amount: number, discount: number }) => {} pay(discount, amount) // ✅ Does not compile
Crafted with 💛 by Riccardo