Created
June 14, 2024 11:19
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 { VirtualPet } from "./virtual-pet"; | |
// Create a virtual pet and initialize it | |
const neko = new VirtualPet('Neko', 'Red', ['Fly', 'Breath Fire', 'Invisibility']); // 3 seconds | |
neko.displayInfo(); | |
const nya = neko.clone(); // a few milliseconds | |
nya.name = 'Nya'; | |
nya.color = 'Yellow'; | |
nya.displayInfo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment