Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Declaring A Internal Method Of A Class

/*sayName() is an internal method, you cannot use sayName with an instance of Person but you CAN use yellName*/
class Person{
	 	
		constructor(name)
		 {
			 this.name = name;
			 this.sayName();
           this.yellName = function()
           {console.log(this.name);
           }
		 }
		 
	 		  sayName()
		 {
		 	
			console.log(this.name)
		 }
	 }
Comment

PREVIOUS NEXT
Code Example
Javascript :: A Nodule Module For ExpressJS 
Javascript :: var a = x || y Variable Assignment In JavaScript 
Javascript :: react router how to prevent navlink from two classes 
Javascript :: JavaScript: Cycle through three-state checkbox states 
Javascript :: map sord elo 
Javascript :: empty or remove div span class 
Javascript :: what does the text before an object stand for in js 
Javascript :: array operations = map, filter, find, reduce, some, every, indexOf 
Javascript :: how to return data from function in javascript 
Javascript :: registration page validation in react 
Javascript :: CUSTOM_ELEMENTS_SCHEMA 
Javascript :: JavaScript get div height dynamically without jQuery 
Javascript :: prisma write database 
Javascript :: errors thrown inside asynchronous functions will act like uncaught errors 
Javascript :: get element position react 
Javascript :: var logEvenNums = function(num) {}; 
Javascript :: get data from multiple api in react 
Javascript :: how to write code for browser back button in javascript 
Javascript :: clear an array 
Javascript :: react custum toogle 
Javascript :: convert string to number 
Javascript :: axios response error interceptor 
Javascript :: javascript every function 
Javascript :: fs.writefile promise 
Javascript :: find all the prime numbers in the array 
Javascript :: animate js 
Javascript :: Run FEnvQueryRequest 
Javascript :: findPotentialLikes javascript 
Javascript :: javascript Access String Characters 
Javascript :: JavaScript pauses the async function until the promise 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =