JavaScript Design Patterns - Structural - Adapter
The adapter pattern allows classes to work together, creating a class interface into another one.
In this example, we use a SoldierAdapter to use the legacy method attack() in our current system and can support the new version of Soldiers SuperSoldie...
nhannguyen.hashnode.dev2 min read