Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript enum

enum EMoney {
	gopay = 'gopay',
	dana = 'dana',
	ovo = 'ovo'
}

enum Bank {
	bca = 'bca',
	mandiri = 'mandiri',
	bri = 'bri'
}

interface OnlineShop<T> {
	payment: T
}

const payment: OnlineShop<Bank> = {
	payment: Bank.bca
}
Source by www.typescriptlang.org #
 
PREVIOUS NEXT
Tagged: #typescript #enum
ADD COMMENT
Topic
Name
6+1 =