I want to display a message in the "toString" method about the status of a character true or false, depending on its health
function Character() { this.health = 100; this.basicDamage = 10; this.toString = function () { return this.name + this.status; // the properties that I want to reflect } } Character.createArcher = function () { var hero = new Character; hero.name = "Legolas"; // set hero name return hero; }; Character.isAlive = function () { var hp = new Character; if (this.health > 0){ hp.status = true; }else if (this.health <= 0){ hp.status = false; }else { alert("ERROR"); } return hp; }; var archer = new Character.createArcher(); console.log(archer.toString());