Code for product option selections in wix stores

Hello Velo Community,

I’m hoping someone can identify how to access product option selections in Wix stores. I’ve attached some of the code below. This is part of an onNewOrder backend code.

It works fine to extract the information but I just need to be able to access all product option selections. At the moment, the current structure only returns the first product option selection.

The Wix Stores/Orders collection has the following lineitem output.

“options”: [
{
“option”: “Portion”,
“selection”: “Large”
},
{
“option”: “Length”,
“selection”: “Long”
},
{
“option”: “Cut”,
“selection”: “tear-off”
},
{
“option”: “Button”,
“selection”: “Snap”
}
],
How does one access for e.g the selection for “option”: “Button”.

Below is the working code which returns the first product option selection.

 let OrderIDItems = [], OrderIDItem = {}, lineItem = {};
 let lineItems = results.lineItems;
 
 For (var i = 0; i < lineItems.length; i++) {
        lineItem = lineItems[i];

 OrderIDItem = "options": lineItem.options[i]['selection'

Grateful for any assistance!