I have an array like
let arr = [
{ key: "Text1", value: "Line 1" },
{ key: "Text2", value: "Line 2" },
{ key: "Text3", value: "Line 3" }
]
and I want to turn it into
let obj = {
"Text1": "Line1",
"Text2": "Line2",
"Text3": "Line3"
}
in es6 i was trying something like this but that's definitely wrong. Any help please?
let temp = Object.assign({}, ...arr.map( {key, value} => ( {key, value} ) ));