Search
 
SCRIPT & CODE EXAMPLE
 

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());
		}
Comment

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());
		}
Comment

PREVIOUS NEXT
Code Example
Javascript :: switching light bulbs problem javascript 
Javascript :: inspect vuex store 
Javascript :: 120. Triangle - JavaScript Solution With Explantion 
Javascript :: Creating getLastBlock Object for blockchain 
Javascript :: puppeteer create folder 
Javascript :: This Refers To The Window Object Here 
Javascript :: force browser reload page from server javascript 
Javascript :: Self Invoking Function Tip 
Javascript :: react sate and props 
Javascript :: electron write to csv 
Javascript :: js get first elements of array 
Javascript :: cookie in Auth header 
Javascript :: give call suggestions while clicking on a contact number in next js 
Javascript :: Using an object of functions as a parameter into a function 
Javascript :: add text to each element in an array javascript 
Javascript :: withrouter in react-router v6 
Javascript :: stringToCapital.js 
Javascript :: How to Loop Through an Array with a While Loop in JavaScript 
Javascript :: react creating function to call API in app: calling APIs after render w error message 
Javascript :: Different Pages For Different Routes In Backbone 
Javascript :: site:stackoverflow.com how to see all react dependencies 
Javascript :: java scrypt 
Javascript :: how to scroll element in javascript 
Javascript :: use of prototype in javascript 
Javascript :: react onsubmit get form values 
Javascript :: Access to localhost from other machine - Angular 
Javascript :: upload image with react 
Javascript :: how to add prefix to a string in javascript 
Javascript :: inappbrowser hide url 
Javascript :: JavaScript built-in methods 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =