Query:
I'm working on a JavaScript project and I have an array that looks like this: [6.7, 8, 7, 8.6]
. I need to transform this array into an array of objects with named properties:
[{y: 6.7} , {y: 8}, {y: 7}, {y: 8.6}].
Can someone guide me on how to achieve this in JavaScript?
Thank you in advance!