0

I am trying to convert an object containing map to json using JSON.stringify(). But after the conversion map data gets cleared. How do i solve this issue?

frieghtChargesJSon:string; //declared variable frieghtChargesJSon=JSON.stringify(frieghtChargeInfo)

I want to convert object itself to JSon ,not just the map

shyni
  • 90
  • 12

1 Answers1

0

You can use

string = JSON.stringify(Array.from(map.entries()));
Abhisar Tripathi
  • 1,569
  • 10
  • 21