Skip to main content
The 2024 Developer Survey results are live! See the results
added 1 character in body
Source Link
metodribic
  • 1.7k
  • 19
  • 28

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]);

and deserialize it with:

let map = new Map(JSON.parse(map));

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]);

and deserialize it with:

let map = new Map(JSON.parse(map))

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]);

and deserialize it with:

let map = new Map(JSON.parse(map));
Rollback to Revision 1
Source Link
am0wa
  • 8.2k
  • 3
  • 40
  • 33

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]); 

and deserialize it with:

let map = new Map(JSON.parse(map)) 

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]); 

and deserialize it with:

let map = new Map(JSON.parse(map)) 

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]);

and deserialize it with:

let map = new Map(JSON.parse(map))
deleted 65 characters in body
Source Link
am0wa
  • 8.2k
  • 3
  • 40
  • 33

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]); 

and deserialize it with:

let map = new Map(JSON.parse(map)) 

output format:

  // [["key1","value1"],["key2","value2"]]

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]); 

and deserialize it with:

let map = new Map(JSON.parse(map)) 

output format:

  // [["key1","value1"],["key2","value2"]]

Using spread sytax Map can be serialized in one line:

JSON.stringify([...new Map()]); 

and deserialize it with:

let map = new Map(JSON.parse(map)) 
added 70 characters in body
Source Link
am0wa
  • 8.2k
  • 3
  • 40
  • 33
Loading
Source Link
metodribic
  • 1.7k
  • 19
  • 28
Loading