Currently, I am using Vue and dealing with a data array that may contain nested arrays. The issue I am facing is that if an item is not stored as an array, I would like to convert it into one for consistency. Here's an example:
my_array:Array[2]
0:Reactive
price_type: "Adult"
price_layer:Array[3]
price:Array[3]
1:Reactive
type: "Child"
price_layer:Array[3]
price: 30
In the second element of my array, there is 'price: 30'. I want this to be changed to 'price: [30]' so that it aligns with the requirements of a for loop in Vue. Is there a method to achieve this without creating a new variable and ensuring the integrity of the remaining data?