Skip to content

Instantly share code, notes, and snippets.

@Caballerog
Created June 14, 2024 11:19
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