Skip to content

Instantly share code, notes, and snippets.

@kudapara
Last active April 18, 2018 20:00
Show Gist options
  • Save kudapara/a55c80c356ac1bf8d8ba1cf3dc2fda4d to your computer and use it in GitHub Desktop.
Save kudapara/a55c80c356ac1bf8d8ba1cf3dc2fda4d to your computer and use it in GitHub Desktop.
Using the shapes file
const circle = new Circle(7)
const square = new Square(3)
const shapes = [circle, square]
const areaCalculator = new AreaCalculator(shapes)
const areaOutput = new CalculatorOutput(areaCalculator)
// now we can access each output type
console.log(output.toString())
console.log(output.toJSON())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment