I have a object which contains the following data:
{cost: 2
field1: 2
field2: 2
field3: 2
field4: 2
length: 2
material: 5715382975332352
name: "name"
stock: 2
thickness: 2
type: "RECTANGULAR"}
Now I want to change the field1, field2, field3 and field4 into something like:
parameters: [2, 2, 2, 2]
so remove the field and turn them into a array with only the values, so the updated object should look like:
{cost: 2
parameters: [2,2,2,2] //values field1, field2, field3, field4
length: 2
material: 5715382975332352
name: "name"
stock: 2
thickness: 2
type: "RECTANGULAR"}
Note: that I can also change the field1, field2 etc.. names if this would be easier for sorting the array.
I tried the following but with no luck: Convert object's properties and values to array of key value pairs