Add value in array object [closed]

var labels = ["Hat", "Chair", "Pen"];
let labelsObject = {};
labels.forEach(label => {
  labelsObject[label] = true;
})

console.log(labelsObject)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top