Is there a way for me to create an object where the key is the same and the values are set from an array.
I want the key = data
and value to be set from an array.
key = data
arr = ['abc', 'pqr', 'xyz']
I need my object to be:
my_obj = [{data: 'abc'}, {data: 'pqr'}, {data: 'xyz'}]
I am not sure how to create such an object.