Подскажите, как правильно написать конструктор, который будет создавать новые объекты и div`ы в разметке. Как правильно связать созданный объект и div?
function Unit(name,life,monsterLeft,monsterBottom) {
this.name = document.createElement('div');
this.className = "monster";
this.style.left= monsterLeft + "px";
this.style.bottom= monsterBottom + "px";
this.life = life;
game.append(this);
this.botRightXDistance = 10;
this.botLeftXDistance = -10;
this.botDownYDistance = -10;
this.botUpYDistance = 10;
}