What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-05 02:19:02
js create object from array
const names = ['Alex', 'Bob', 'Johny', 'Atta']; // convert array to th object const obj = Object.assign({}, names); // print object console.log(obj); // {0: "Alex", 1: "Bob", 2: "Johny", 3: "Atta"} Add solution