This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Composition Example | |
| // http://codepen.io/ericelliott/pen/XXzadQ?editors=001 | |
| // https://gist.github.com/ericelliott/fed0fd7a0d3388b06402 | |
| const distortion = { distortion: 1 }; | |
| const volume = { volume: 1 }; | |
| const cabinet = { cabinet: 'maple' }; | |
| const lowCut = { lowCut: 1 }; | |
| const inputLevel = { inputLevel: 1 }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Class Inheritance Example | |
| // NOT RECOMMENDED. Use object composition, instead. | |
| // https://gist.github.com/ericelliott/b668ce0ad1ab540df915 | |
| // http://codepen.io/ericelliott/pen/pgdPOb?editors=001 | |
| class GuitarAmp { | |
| constructor ({ cabinet = 'spruce', distortion = '1', volume = '0' } = {}) { | |
| Object.assign(this, { | |
| cabinet, distortion, volume |