// Also, the following works well: // IF the array came as follows (you cannot declare an array like that) const obj = Object.assign({}, ['name': 'Alex', 'age': 43, 'gender': 'male']); console.log(obj);