Object Test

by nevkatz

JavaScript

class Sprite {
    constructor({coords, speed}) {
        this.coords = coords;
        this.speed = speed;
    }
}
class Player {
    constructor({coords, speed, health}) {
       this.coords = coords;
       this.speed = speed;
       this.health = health;
    }
}
let player = new Player({speed:1,health:2,coords:3});
console.log(player);