Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Setting Multiples Properties With Array

	 class Ky
	 {
	constructor(method)
		 { 
			 this.method = method;
		

			 const values = ['get','post', 'put', 'delete'];
			 
			 
			 for(const value of values)
			 {this[value] = function()
			 {
			 	
				 return new Ky("POST");			
				
			 }
		 }
		 
 
PREVIOUS NEXT
Tagged: #Setting #Multiples #Properties #With #Array
ADD COMMENT
Topic
Name
1+7 =