Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MainClass {
- constructor() {
- this.playButton = new ShowButton(this.display);
- this.name = "some stuff";
- }
- display() {
- console.log("calling display()");
- console.log(this.name);
- }
- }
- class ShowButton {
- constructor(aPlayFunction) {
- this.x = 100;
- this.y = 100;
- this.button = document.createElement('playButton');
- this.button.innerHTML = 'play';
- this.button.onclick = aPlayFunction;
- document.body.appendChild(this.button);
- }
- }
- let main = new MainClass();
Add Comment
Please, Sign In to add comment