JavaScript object destructuring tips