[JavaScript]Guys this is not an exercice . but please im in tensive need for help to debug it


#1



<script>
function Robot (rName , rx , ry){
this.name = rName ; 
this.x = rx ; 
this.y= ry ; 
this.moveRight = moveRight ; 
this.moveLeft = moveLeft ; 
this.moveForward = moveForward ; 
this.moveBackward = moveBackward ; 
this.greet = greet ; 
this.displayInfo = displayInfo  ;
this.display = display ; 
}
function moveRight(){
this.x= this.x+1 ; 
}

function moveLeft(){
this.x=this.x-1;
}

function moveForward(){
this.y=this.y+1 ; 
}

function moveBackward(){
this.y =this.y-1;
}
function greed(){
window.alert("good morning !");
}
function display (){
document.write("name : " +this.name  );
document.write("<br>");
document.write("x :" + this.x );
document.write("<br>");
document.write("y : "+ this.y );
document.write("<br>");
}

var robName = window.prompt("please enter the name of the robot","type it here!");
var robot1 = new Robot(robName , 0 , 0 );
robot1.greed();

robot1.moveForward();
robot1.moveForward();
robot1.moveForward()

robot1.moveRight();
robot1.moveRight();

robot1.display();

</script>


#2

Hi
I see that in your function Robot, you wrote this.greet = greet ; but you defined a function greed and then call robot1.greed();. I hope it helps