ShoppingCart methods · pick a card, then choose a bucket
⚙ COMMAND
Does something. Changes state. Returns nothing (void).
? QUERY
Answers something. Returns a value. Changes nothing — safe to repeat.
Sort the methods
Click a method card above, then click QUERY or COMMAND to sort it. A query answers (returns a value, changes nothing); a command does (changes state, returns nothing).
Call it twice · does asking the question change the answer?
Cart: [milk, bread, eggs]
▸A method is an order or a question — never both. Sort all six, then face the red TRAP card that breaks the rule.