Skip to content

Comment on Show HN: Virtual pet game made for my daughterparent

Comments

I think I would call it nested destructuring with default values.

Destructuring, that rings a bell. Thank you.

Yeah, the trick is basically many things chained together. First is to pass a object to a function instead of position-locked arguments. Second is to default to a empty object. Third is to destruct the object in the function parameter directly. Fourth to supply default destruct values. Fifth is to set the values in the current instance of that class.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.