Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

typescript reset class properties to default

export class Product{
  productId: number; 
  productName: string = "Apple";
  productDescription: string;
  sideProducts: Array;

  reset() {
    this.productId = 0; //default of number datatype is 0
    this.productName = "Apple";
    this.productDescription = null;
    this.sideProducts = [];
  }
}
Comment

PREVIOUS NEXT
Code Example
::  
::  
Typescript ::  
:: sarasota bowling alley bomb threats incident 
Typescript ::  
::  
::  
Typescript ::  
Typescript :: node rts stream 
Typescript ::  
Typescript ::  
:: online ts compiler 
::  
::  
::  
::  
::  
Javascript ::  
::  
Javascript ::  
::  
::  
Javascript ::  
::  
Javascript ::  
:: react onclick type 
Javascript :: set attribute checked jquery 
::  
Javascript :: how to see in how many servers your discord bot is d.js 
Javascript ::  
ADD CONTENT
Topic
Content
Source link
Name
7+7 =