Re:Show HN: Virtual pet game made for my daughter
by orisa2 on Thursday November 21, 2019 @12:21PM
(#21596610)
From the post, I wasn't sure if you knew, but JS also has regular default parameters if that's all you want.
[ Parent
| on HN ]
Re:Show HN: Virtual pet game made for my daughter
by capableweb on Thursday November 21, 2019 @01:26PM
(#21597519)
Not as nice though, as the arguments still depend on the order. Passing a object gives the benefit of named arguments AND position of the arguments no longer matter (as object keys don't have order and also, it's a object with key/values)