Edit in JSFiddle

function Animal(name, age){
    this.name = name;
   	this.move = function(){
    	document.write(this.name + ' is moving...');
    };
}

var luckyDog = new Animal('Lucky');
luckyDog.move();