Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

dictionary to list of dictionaries js

var dict = {
  "key1" : 100,
  "key2" : 200,
  "key3" : 300
}

var data = Object.entries(dict).map(([key, value]) => ({[key]: value}))

console.log(data)
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dictionary #list #dictionaries #js
ADD COMMENT
Topic
Name
9+3 =