Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

this function

function country(name , independenceOn) {

  this.name = name
  this.independenceOn = independenceOn

  this.describe = function () {
    console.log(this.name + " got its independence on " + this.independenceOn + " WHAHAHAHAH")
  }
}

const india = new country('The Country India', 1947)
india.describe()
 
PREVIOUS NEXT
Tagged: #function
ADD COMMENT
Topic
Name
8+1 =