-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
  • 37,528
  • 9
  • 64
  • 91
Geek
  • 3,137
  • 14
  • 60
  • 104

1 Answers1

1
caseStatusList.map(item => item.descr).join(',')
Wai Ha Lee
  • 8,173
  • 68
  • 59
  • 86
Ali Baykal
  • 196
  • 1
  • 5