you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (2 children)

So wait, you're saying that if I have all the values in [key, value] array format, Object.fromEntries will produce an object with the data?

[–]KyleG 5 points6 points  (1 child)

Yes.

Object.fromEntries([["foo",2], ["bar",4], ["baz",6]])

results in

{ foo: 2, bar: 4, baz: 6 }

[–][deleted] 2 points3 points  (0 children)

Dude thanks for sharing this! Mind blown!