Burger
+ Burger(bun, patty, cheese,
lettuce, tomato, sauce)
The telescoping constructor
1new Burger("wheat", true, false, true, true, false, "bbq");2// bun patty cheese ... which flag is which??
State
call siteunreadable 💥
Construct a complex object step by step with a readable, chainable API — instead of a monster constructor full of flags.
1new Burger("wheat", true, false, true, true, false, "bbq");2// bun patty cheese ... which flag is which??
A Burger with many optional parts forces a giant constructor — a wall of positional flags.