SharePointPunk
Programmer
I am trying to write a simple method to add to my object constructor. All the standard property's work fine but I cant get the method to return anything.
I am not sure if it needs to be a prototype since its inside a constructor.
Thanks for your help!
I am running "console.log(HR.Info);" inside firebug and getting undefined also once it returned function() not sure why.
<script>
var Opening = function(Position, Salary, Title){
this.Position = Position;
this.Salary = Salary;
this.Title = Title;
this.Info = function(){
return "You will be working in"+ Position +"making" + Salary +"you will be called" + Title;
}
}
var HR = new Opening("IT", 110000, "Director");
</script>
I am not sure if it needs to be a prototype since its inside a constructor.
Thanks for your help!
I am running "console.log(HR.Info);" inside firebug and getting undefined also once it returned function() not sure why.
<script>
var Opening = function(Position, Salary, Title){
this.Position = Position;
this.Salary = Salary;
this.Title = Title;
this.Info = function(){
return "You will be working in"+ Position +"making" + Salary +"you will be called" + Title;
}
}
var HR = new Opening("IT", 110000, "Director");
</script>