That worked exactly as I wanted but how? and why?
I needed to splice ring in order to get [ value] , [value] separated, then map them to return each one of them in the formatted order
You have an array of strings (ring).
Map says “Make a copy of this array. Take each of the things in the array, and replace them with the result of my function.”
The function just says: “Take what was given (the string), stuff it into an object property called “name”, and return the object.”
So you end up with an array of the returned things. Which are objects.