Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

create class function

class LinkedList {
   constructor() {
      this.length=100;
   }
   //this is the function: 
   functionName() {
       console.log(this.length);
   }
}

//we call it like this : 
first create new class from the LinkedList : 
const newClass =new LinkedList();
//then call the function :
newClass.functionName() // output : 100
 
PREVIOUS NEXT
Tagged: #create #class #function
ADD COMMENT
Topic
Name
7+7 =