You can use map
const words = ["hello", "world", "how", "are", "you"]
let op = words.map((value,key) => ({[key]: value}))
console.log(op)
solved how to turn array into array of objects
You can use map
const words = ["hello", "world", "how", "are", "you"]
let op = words.map((value,key) => ({[key]: value}))
console.log(op)
solved how to turn array into array of objects