-2

I have a list as follows:

caseStatusList: Array(3)
0: {id: 2, descr: "EEO"}
1: {id: 3, descr: "EE"}
2: {id: 7, descr: "E"}

I want to use a typescript function to convert this caseStatusList to a string seperated by comma as follows:

String caseStatusList = EEO,EE,E

I want to do this in typescript in angular.ts file. What is the best way to do ?

eko
  • 39,722
  • 10
  • 72
  • 98
Geek
  • 3,187
  • 15
  • 70
  • 115

1 Answers1

1
caseStatusList.map(item => item.descr).join(',')
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Ali Baykal
  • 314
  • 2
  • 5