Bark Bark

mail@pastecode.io avatar
unknown
abap
2 years ago
538 B
0
Indexable
Never
// Set up the app
var app = new App();

// Define a Dog class
class Dog {
  constructor(name, breed, bark) {
    this.name = name;
    this.breed = breed;
    this.bark = bark;
  }
}

// Create a new instance of the Dog class
var dog = new Dog("Max", "Golden Retriever", "Woof!");

// Set up a button to trigger the dog's bark
var barkButton = new Button("Bark");
barkButton.onClick(function() {
  // Play the dog's bark sound
  playSound(dog.bark);
});

// Add the bark button to the app
app.add(barkButton);

// Run the app
app.run();