Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Class Which Can Create An Instance Of The Same Type

	 class Person
	 {
	
	constructor(name)
		 { 
			 this.name = name;
this.post = function()
			 {
			 	
				 return new Person("YAYAYAYAYAYA");			
				
			 }
			 this.json = async function()
			 {
			 	
		let t=		await fetch("/test", {method:"POST"});
		return await t.json();
			 }
		 } 	
		
	 }
	async  function send()
	 {	
		

		 let p = new Person("YABREW");
		 console.log(await p.post().json());
		}
 
PREVIOUS NEXT
Tagged: #Class #Which #Can #Create #An #Instance #Of #The #Same #Type
ADD COMMENT
Topic
Name
3+2 =