I have the following structure and I would like to change keys name from this
let FIELDS = ['id', 'first_name', 'last_name', 'email']
let {...obj} = ['123','John','Doe', null]
console.log(obj) // {0: '123', 1: 'John', 2: 'Doe', 3: null}
to something like this
console.log(obj) // {id: '123', first_name: 'John', last_name: 'Doe', email: null}