Difference between revisions of "Constructors"

From rbachwiki
Jump to navigation Jump to search
Line 13: Line 13:
balance.display();
balance.display();
</pre>
</pre>
==[[#top|Back To Top]]-[[Main_Page| Home]] - [[Java Script|Category]]==

Revision as of 19:13, 25 October 2016

Constructor

function Balance(current, deposit){
  this.current = current;
  this.deposit = deposit;
  this.display=function(){
    current +=deposit;
    console.log(current);
  }
}
var balance = new Balance(100,24);
balance.display();

Back To Top- Home - Category