Created
June 14, 2024 11:04
-
-
Save Caballerog/bde69c185f72bf6354780cae1d3ca73c to your computer and use it in GitHub Desktop.
This file contains 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
import { ConcretePrototype1 } from "./concrete.prototype1"; | |
import { ConcretePrototype2 } from "./concrete-prototype2"; | |
// Create instances of ConcretePrototype1 and ConcretePrototype2 | |
const concretePrototype1 = new ConcretePrototype1(); | |
const concretePrototype2 = new ConcretePrototype2(); | |
// The operation method is called on the instances | |
concretePrototype1.operation(); | |
concretePrototype2.operation(); | |
// Cloning the instances | |
const clonedPrototype1 = concretePrototype1.clone(); | |
const clonedPrototype2 = concretePrototype2.clone(); | |
// Show the information of the cloned instances | |
clonedPrototype1.operation(); | |
clonedPrototype2.operation(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment