3 ms·
The DRY example is better though. The payload is an object. When you have multiple objects of the same shape you have a class of objects. Menu items could be lo
by Flankk 4y ago
The DRY example is better though. The payload is an object. When you have multiple objects of the same shape you have a class of objects. Menu items could be loaded from a JSON source. Separation of concerns and duplication is removed from the code.